Last active
February 14, 2023 12:27
-
-
Save dcortesnet/7b6565c2647d579e2fa0a5e591338266 to your computer and use it in GitHub Desktop.
Nodejs send email with sendgrid
This file contains hidden or 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
| const sgMail = require('@sendgrid/mail'); | |
| sgMail.setApiKey(process.env.SENDGRID_API_KEY); | |
| const msg = { | |
| to: "test@example.com", | |
| from: 'test@example.com', | |
| subject: 'Sending with SendGrid is Fun', | |
| text: 'and easy to do anywhere, even with Node.js', | |
| html: '<strong>and easy to do anywhere, even with Node.js</strong>', | |
| }; | |
| sgMail.send(msg); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment