How to use the @sendgrid/mail.sendMultiple 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 serverless / forms-service / backend / lib / utils / sendEmail.js View on Github external
`

  const fromEmail = 'contact@serverless.com'
  const replyTo = formData.email || 'no-reply@serverless.com'
  const subject = `New submission on form ${formData.formId}`

  console.log('to', to)

  const msg = {
    to: to,
    from: fromEmail,
    replyTo: replyTo,
    subject: subject,
    html: emailContent,
  }
  sgMail.sendMultiple(msg, function (error, response) {
    if (error) {
      console.log('Sendgrid error response received', error)
    }
    return callback(error, response)
  })
}
github dan335 / dominus / packages / dominus-control / mailinglist / server / mailinglistMethods.js View on Github external
chunks.forEach(function(to) {
      const msg = {
        to: to,
        from: 'dan@dominusgame.net',
        templateId: job.data.templateName
      };

      if (Meteor.settings.public.dominusIsDev) {
        //console.log('sendToMailingList', job.data.templateName, to.length);
        console.log(msg);
        sgMail.sendMultiple(msg);
      } else {
        sgMail.sendMultiple(msg);
      }
    });
github lowercasename / gathio / routes.js View on Github external
console.log("Sending emails to: " + attendeeEmails);
						const msg = {
							to: attendeeEmails,
							from: {
								name: 'Gathio',
								email: 'notifications@gath.io',
							},
							templateId: 'd-e21f3ca49d82476b94ddd8892c72a162',
							dynamic_template_data: {
								subject: 'gathio: Event "' + event.name + '" deleted',
								actionType: 'deleted',
								eventExists: false,
								eventID: req.params.eventID
							}
						}
						sgMail.sendMultiple(msg);
					}
					else {
						console.log("Nothing to send!");
					}
				});
			}
github foundersandcoders / open-tourism-platform / src / helpers / sendEmail.js View on Github external
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)
}
github patrickmichalina / fusing-angular-v1-archived / src / server / services / email.service.ts View on Github external
sendMultiple(mailData: ReadonlyArray) {
    return fromPromise(sendGrid.sendMultiple(mailData as any))
  }
}
github hackmcgill / hackerAPI / services / email.service.js View on Github external
sendMultiple(mailData, callback = () => {}) {
        return client.sendMultiple(mailData, (error) => {
            if (error) {
                logger.error(`${TAG} ` + JSON.stringify(error));
                callback(error);
            } else {
                callback();
            }
        });
    }
    /**

@sendgrid/mail

Twilio SendGrid NodeJS mail service

MIT
Latest version published 4 months ago

Package Health Score

91 / 100
Full package analysis

Similar packages