Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import sendGrid from '@sendgrid/mail'
sendGrid.setApiKey(process.env.SENDGRID_API_KEY || '')
sendGrid.setSubstitutionWrappers('{{', '}}')
export default sendGrid
const sgMail = require('@sendgrid/mail')
const User = require('../models/User')
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
sgMail.setSubstitutionWrappers('{{', '}}')
const sendEmails = (emails, content) => {
const msg = {
to: emails,
from: 'opentourismplatform@gmail.com',
templateId: '0839aec2-dd34-459d-9493-4fd9682b9073',
substitutions: {
name: content.en.name,
id: content._id
}
}
sgMail
.sendMultiple(msg)
}