ノードsendgrid ICAS/ICSの招待状:私ができる招待状を送りたい私のメールのいくつかのために今私は、次のモジュールを作成しているこれでNPM <code>sendgrid</code><a href="https://github.com/sendgrid/sendgrid-nodejs" rel="nofollow">node sendgrid github</a></p> <p>を使用しています
var path = require('path'),
emailTemplates = require('email-templates'),
async = require("async"),
mailConfig = require('../config/email.json'),
templates = require('../config/emailTemplates.json'),
_ = require('lodash'),
sendgrid = require('sendgrid')(mailConfig.sendGridApiKey),
fs = require("fs");
var mymailer = {};
/**
* Sends an email to either one or multiple users
* @param template_id (The id key of the template. Can be found in emailTemplates.json
* @param to String or Array
* @param from String
* @param subject String
* @param keyReplacer Array of objects for keys to replace in the template
* @param files Array of file objects
*/
mymailer.sendTemplate = function (template_id, to, from, subject, keyReplacer, section, text, files) {
var email = new sendgrid.Email(), templateKey = templates[template_id];
if (templateKey) {
email.setSmtpapiTos(to);
email.subject = subject;
email.from = from;
email.text = text;
email.html = 'Gief HTML NU:D';
email.setFilters({
"templates": {
"settings": {
"enable": 1,
"template_id": templateKey
}
}
});
email.smtpapi.header.sub = prepareSub(keyReplacer, section);
email.smtpapi.header.section = prepareSection(section);
email.files = prepareAttachement(files);
sendgrid.send(email);
} else {
console.log('incorrect key');
}
};
をあなたのカレンダーで受け入れられます。しかし、私はこれを行う方法がわからないし、私はその件についての情報を見つけることができません。
誰かがsendgridを使ってこれを送信しようとしましたか?もしそうなら、正しい方向に私を向けることができますか?