Skip to content

Instantly share code, notes, and snippets.

@rafaelvicio
Created April 8, 2019 19:43
Show Gist options
  • Select an option

  • Save rafaelvicio/5d27aa29fafe4c0772440de410c7a8bb to your computer and use it in GitHub Desktop.

Select an option

Save rafaelvicio/5d27aa29fafe4c0772440de410c7a8bb to your computer and use it in GitHub Desktop.
"use strict";
const sgMail = require("@sendgrid/mail");
module.exports.hello = function(context) {
context.log("JavaScript HTTP trigger function processed a request.");
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
to: "[email protected]",
from: "[email protected]",
subject: "Reminder Labor",
html: "<strong>Please check out their activities at Labor</strong>"
};
sgMail.send(msg);
context.res = {
body: "Go Serverless v1.x! Your function executed successfully!"
};
context.done();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment