【发布时间】:2016-10-23 19:39:14
【问题描述】:
我有一个用户为其应用程序填充的带有角度的表单句柄。 它工作正常,我使用 Mandrill API 发送电子邮件,如下所示:
var m = new mandrill.Mandrill('your_api_key'); // This will be public
function sendTheMail(){
m.messages.send({
"message": {
"from_email": "your_email_address",
"from_name": "your_name",
"to":[{"email": "someone's_email_address", "name": "someone's_name"}], // Array of recipients
"subject": "optional_subject_line",
"text": "Text to be sent in the body" // Alternatively, use the "html" key to send HTML emails rather than plaintext
}
});
}
现在我想让用户向他们的应用程序添加一个 pdf 附件。我可以将格式限制为 PDF 并且尺寸相对较小。
最简单的方法是什么?是否需要添加 https://github.com/nervgh/angular-file-upload 之类的模块?
非常感谢
【问题讨论】:
-
mandrill 支持
base64附件,因此将文件编码为base 64并附加,它只支持最大25 MB。 stackoverflow.com/questions/23025414/…
标签: javascript angularjs forms mandrill