我正在尝试将HTML文件插入变量中,因此我的代码更加简洁。 我可以将HTML文件插入变量中,然后发送电子邮件吗?
这就是我的尝试。
import htmlEmail from '../../client/imports/core/auth/email/invite-email.html';
Meteor.methods({
'email.send'(credential) {
var emailData = {
email : credential.email,
name : credential.name
};
let res = Email.send({
from : 'noreply@tim.io',
to : credential.email,
subject : 'Email Invitation',
html : htmlEmail
});
return res;
},
});
而不是这样
html : '<body><div>You have invitation by My apps</div> </body>'
感谢您的关注