Mailgun:发送图像(HTML)和文本从Parse只显示HTML
Mailgun : sending image(HTML) and text from Parse shows only html
这是我使用的代码
Parse.Cloud.define("blendedBookMailToUser", function(request, response) {
var Mailgun = require('mailgun');
Mailgun.initialize('SandBoxCode', 'Key');
Mailgun.sendEmail({
to: "someone@gmail.com",
from: "me@me.com",
subject: "Session Booked",
text: "HIIIIIIIIIIII" ,
html:'<html><body style="text-align:center;"><img border="0" src="' + request.params.qrUrlKey + '" width="200" height="200" ></body></html>',
}, {
success: function(httpResponse) {
console.log(httpResponse);
response.success("Email sent!");
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});
});
我收到邮件,但只有html部分-所以我只能看到没有文本的图像。如果我删除html部分,我将收到文本。
如何组合它们?有没有更好的方法来包含图像?
使用ios和Parse云代码
Text表示电子邮件的文本版本,而as HTML表示电子邮件的HTML版本。
为了查看文本,将文本合并到您的html版本的电子邮件中。
的例子:
var textMessage = "some text message";
Mailgun.sendEmail({
to: "someone@gmail.com",
from: "me@me.com",
subject: "Session Booked",
text: textMessage ,
html:'<html><body style="text-align:center;"><img border="0" src="' + request.params.qrUrlKey + '" width="200" height="200" >' + textMessage + '</body></html>',
}, {
success: function(httpResponse) {
console.log(httpResponse);
response.success("Email sent!");
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});
这将把文本信息放在图片的下方。
相关文章:
- 用JavaScript替换Android WebView模板上的html文本
- 仅IE8 html文本框中的字符
- HTML文本框中的javascript数字
- HTML文本输入大小
- 如何放置ÅÄ和#214;在javascript数组中,然后将其与html文本进行比较
- 如何以非编程方式国际化HTML文本
- 在 PHP 块中使用 Javascript 设置 HTML 文本框的值(使用 echo)
- jQuery在用新文本替换HTML文本时淡出HTML文本,而不是仅显示
- HTML文本框,它接受电话号码,并以美国电话号码格式显示
- Javascript按钮,在html文本区域中插入一个大黑点(•)
- 更换163;使用javascript从html文本区域中提取字符
- 单击或点击切换HTML文本
- 单击即可编辑HTML文本
- 分析Adobe InDesign的HTML文本——其他标记中的标记
- 如何将mysql查询的结果获取到html文本框中
- 当使用javascript/jquery添加值时,html文本输入表显示不正确
- 如何将 HTML 文本同步并突出显示到音频
- 如何使用 JQuery 从相对元素获取 html 文本
- 根据用户选择的输入编写 html 文本
- MVC 4:使用 JQUERY 和 PartViewResult 动态创建 HTML 文本框.如果代码是动态添加的,如何