-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from ubc-biztech/dev
Update email message if QR code doesn't display; add SNS topic for monitoring
- Loading branch information
Showing
12 changed files
with
1,440 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
SNSClient, PublishCommand | ||
} from "@aws-sdk/client-sns"; | ||
|
||
const snsClient = new SNSClient({ | ||
region: "us-west-2" | ||
}); | ||
|
||
export async function sendSNSNotification(message, topicArn = process.env.SNS_TOPIC_ARN) { | ||
const params = { | ||
Message: JSON.stringify(message), | ||
TopicArn: topicArn | ||
}; | ||
|
||
try { | ||
const command = new PublishCommand(params); | ||
await snsClient.send(command); | ||
console.log("SNS notification sent successfully"); | ||
} catch (error) { | ||
console.error("Error sending SNS notification:", error); | ||
throw error; // Rethrow the error so the calling function can handle it if needed | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.