Easily send notifications to Slack, Email, or SMS.
yarn add @beatgig/hermes
import { sendNotification } from '@beatgig/hermes'
await sendNotification({
channels: ['email', 'slack', 'sms'],
email: {
to: user.email,
subject: 'Reset your Password',
template: TEMPLATE_RESET_PASSWORD,
templateData: {
link,
},
apiKey: process.env.MAILGUN_API_KEY,
domain: process.env.MAILGUN_DOMAIN
},
slack: {
channel: 'testing',
message: 'User #1234 has requested a password reset.'
emoji: ':fire:',
blocks: [...block data],
token: process.env.SLACK_TOKEN
},
sms: {
to: user.phone,
message: 'A password reset request was received for your account. If this was not you, please contact us immediately.',
accountSid: process.env.TWILIO_ACCOUNT_SID,
token: process.env.TWILIO_TOKEN
}
})
yarn test