()
| 21 | sendgrid.setApiKey(process.env.SENDGRID_API_KEY || '<your-sendgrid-api-key>'); |
| 22 | |
| 23 | async function sendgridExample() { |
| 24 | await sendgrid.send({ |
| 25 | to: 'to_email@example.com', |
| 26 | from: 'from_email@example.com', |
| 27 | subject: 'Sendgrid test email from Node.js on Google Cloud Platform', |
| 28 | text: 'Well hello! This is a Sendgrid test email from Node.js on Google Cloud Platform.', |
| 29 | }); |
| 30 | } |
| 31 | sendgridExample(); |
| 32 | // [END compute_sendgrid] |