2016-03-28 4 views
0

startup.js角の流星を使って電子メールを送信し、電子メールにテンプレートデザインを追加するにはどうすればよいですか?私はこれを使用しています:

SMTP = { 名: '[email protected]'、
パスワード: 'alpha123e'、
サーバー: 'smtp.gmail.com'、
ポート:465 }

process.env.MAIL_URL = 'SMTP://' + encodeURIComponentで(smtp.username)+ ':' + encodeURIComponentで(smtp.password)+ '@' + encodeURIComponentで(smtp.server )+ ':' + smtp.port;

流星方法

Meteor.methods({ sendEmail: function (to, from, subject, text) { 
check([to, from, subject, text], [String]); 

this.unblock(); 

Email.send({ 
    to: to, 
    from: from, 
    subject: subject, 
    text: text 
}); 
} 
}); 

答えて

0

あなたは電子メールで、テンプレートのデザインを使用したい場合は、電子メールのhtml財産だけではなく、textを設定することをお勧めします。

Email.send({ 
    to: to, 
    from: from, 
    subject: subject, 
    html: "<h1>Hello World</h1>", 
    text: "Hello World" 
}); 

meteorhacks:ssrパッケージは、サーバー側のテンプレートのレンダリングに非常に役立ちます。

関連する問題