Javascript Mailgun:从解析发送图像(HTML)和文本只显示HTML

Javascript Mailgun:从解析发送图像(HTML)和文本只显示HTML,javascript,parse-platform,parse-cloud-code,mailgun,Javascript,Parse Platform,Parse Cloud Code,Mailgun,这是我使用的代码 Parse.Cloud.define("blendedBookMailToUser", function(request, response) { var Mailgun = require('mailgun'); Mailgun.initialize('SandBoxCode', 'Key'); Mailgun.sendEmail({ to: "someone@gmail.com", from: "me@me.co

这是我使用的代码

  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");
  }
});
                   });
Parse.Cloud.define(“blendedBookMailToUser”,函数(请求、响应){
var Mailgun=require('Mailgun');
Mailgun.initialize('SandBoxCode','Key');
Mailgun.sendmail({
至:someone@gmail.com",
来自:me@me.com",
主题:“已预订会话”,
文本:“HIIIIII”,
html:“”,
}, {
成功:函数(httpResponse){
console.log(httpResponse);
回复。成功(“发送电子邮件!”);
},
错误:函数(httpResponse){
控制台错误(httpResponse);
错误(“哦,出了点问题”);
}
});
});
我收到了邮件,但是只有html部分,所以我只能看到图像而没有文本。。 如果我删除html部分,我将收到文本

我怎样才能把它们结合起来?有没有更好的方法来包含图像


使用ios和解析云代码。

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");
  }
});
var textMessage=“一些文本消息”;
Mailgun.sendmail({
至:someone@gmail.com",
来自:me@me.com",
主题:“已预订会话”,
text:textMessage,
html:“”+textMessage+“”,
}, {
成功:函数(httpResponse){
console.log(httpResponse);
回复。成功(“发送电子邮件!”);
},
错误:函数(httpResponse){
控制台错误(httpResponse);
错误(“哦,出了点问题”);
}
});

这会将文字信息放在图像下方

这是接收邮件的原始视图--33cd9261657a412cb62ef49d3b376c2e内容类型:text/plain;charset=“ascii”Mime版本:1.0内容传输编码:7bit HIIIIII--33cd9261657a412cb62ef49d3b376c2e内容类型:text/html;charset=“ascii”Mime版本:1.0内容传输编码:7比特-文本在某处-但我在gmail上看不到它。。。