Skip to content

Instantly share code, notes, and snippets.

@rafaelvicio
Created April 8, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelvicio/5d27aa29fafe4c0772440de410c7a8bb to your computer and use it in GitHub Desktop.
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: "rafael@novatics.com",
from: "no-reply@novatics.com.br",
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