我已經將我的流星更新爲1.2,現在我正嘗試使用電子郵件附件功能,但不知道如何。流星電子郵件附件
流星指南說,是指this,但它不是非常有幫助..
if(true == true){
var dataAttachments = attachment;
var dataText =
"Client Name: " + name +
"\rEmail: " + email +
"\rPhone: " + phone +
"\rCompany: " + company +
"\rDeliverables: " + deliverables +
"\rCopywriting: " + copywriting +
"\rPrint Services: " + print +
"\rIllustration: " + illustration +
"\rphotography: " + photography +
"\rTimelines: " + timelines +
"\rBudget: " + budget +
"\rDescription: " + description;
Meteor.call('sendEmail', dataText, dataAttachment);
//throwAlert is my helper method which creates popup with message
alert('Email sent');
}else{
alert('An error occurred. Sorry');
return false;
}
}
});
和
Meteor.methods({
sendEmail: function (text) {
check([text], [String]);
this.unblock();
Email.send({
to: '[email protected]',
from: '[email protected]',
subject: 'New message from contact form',
text: text
});
Email.send().addAttachment(attachment);
}
});
你究竟試過了什麼,以什麼方式不起作用? –