Update how to use sendgrid
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// EmailService.js
|
// EmailService.js
|
||||||
var sendgrid = require("sendgrid");
|
var sendgrid = require("sendgrid")(sails.config.email.apiKey);
|
||||||
var thenJade = require("then-jade");
|
var thenJade = require("then-jade");
|
||||||
|
|
||||||
exports.sendOrderEmail = function(inviteeData) {
|
exports.sendOrderEmail = function(inviteeData) {
|
||||||
@@ -29,8 +29,7 @@ exports.sendOrderEmail = function(inviteeData) {
|
|||||||
|
|
||||||
options.html = result;
|
options.html = result;
|
||||||
|
|
||||||
var sg = sendgrid(sails.config.email.apiUser, sails.config.email.apiKey);
|
sendgrid.send(options, function(err, response) {
|
||||||
sg.send(options, function(err, response) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
//
|
//
|
||||||
module.exports.email = {
|
module.exports.email = {
|
||||||
apiUser: "benjaminramey",
|
apiUser: "benjaminramey",
|
||||||
apiKey: "AVidasUPthub6pY3fFGe",
|
apiKey: "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",
|
||||||
fromAddress: "no-reply@lunchrun.me"
|
fromAddress: "no-reply@lunchrun.me"
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user