-
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.
Browse files
Browse the repository at this point in the history
#303 introduce aws ses
- Loading branch information
Showing
17 changed files
with
277 additions
and
89 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { slackWebhookUrl: slackUrl } = require("../../loadenv"); | ||
const axios = require("axios"); | ||
const logger = require("../modules/logger"); | ||
|
||
module.exports.notifyToReportChannel = (reportUser, report) => { | ||
if (!slackUrl.report) return; | ||
|
||
const data = { | ||
text: `${reportUser}님으로부터 신고가 접수되었습니다. | ||
신고자 ID: ${report.creatorId} | ||
신고 ID: ${report.reportedId} | ||
방 ID: ${report.roomId ?? ""} | ||
사유: ${report.type} | ||
기타: ${report.etcDetail} | ||
`, | ||
}; | ||
const config = { "Content-Type": "application/json" }; | ||
|
||
axios | ||
.post(slackUrl.report, data, config) | ||
.then((res) => { | ||
logger.info("Slack webhook sent successfully"); | ||
}) | ||
.catch((err) => { | ||
logger.error("Fail to send slack webhook", err); | ||
}); | ||
}; |
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
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
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.