How to use the @sendgrid/mail.setSubstitutionWrappers function in @sendgrid/mail

To help you get started, we’ve selected a few @sendgrid/mail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ZolaApp / zola-api / src / server / sendGrid.js View on Github external
// @flow
import sendGrid from '@sendgrid/mail'

sendGrid.setApiKey(process.env.SENDGRID_API_KEY || '')
sendGrid.setSubstitutionWrappers('{{', '}}')

export default sendGrid
github foundersandcoders / open-tourism-platform / src / helpers / sendEmail.js View on Github external
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)
}

@sendgrid/mail

Twilio SendGrid NodeJS mail service

MIT
Latest version published 1 month ago

Package Health Score

95 / 100
Full package analysis

Similar packages