【发布时间】:2021-09-03 02:35:03
【问题描述】:
var recipients = ['ertemishakk@gmail.com']
var recipientVars = {
"ertemishakk@gmail.com": {
"first": "Ertem",
"productImage": "https://ojeaustralia.s3.ap-southeast-2.amazonaws.com/IMG_4825.jpg1602122333765",
"productName": "Black Marble",
"productLink": "https://www.ojeaustralia.com.au/shop/Black-Marble/5f7af208ea0e37001763a350"
}
}
var data = {
sender: 'ojeaustralia.com.au',
from: 'OJE AUSTRALIA <support@ojeaustralia.com.au>',
to: recipients,
subject: 'Did you forget something?',
template: 'abandonedcart',
"X-Mailgun-Recipient-Variables": JSON.stringify(recipientVars)
};
mailgun.messages().send(data, function (error, body) {
console.log(body);
});
我无法使用变量发送批量电子邮件。我不需要创建邮件列表,因为这只是在电子商务网站上检查废弃购物车的一项 cron 工作。我需要为将物品留在购物车中的人发送自定义电子邮件。但是,发送批量电子邮件不起作用,并且 API 中没有很好地记录。
【问题讨论】: