简体   繁体   English

如何使用Mailgun和Node.js发送批量个性化电子邮件

[英]How to send bulk personalized email using mailgun & nodejs

The requirement is to send personalized email to more than 50k users, the recipient should be addressed by their names like below: 要求是向超过5万名用户发送个性化电子邮件,收件人的姓名应如下所示:

Subject : Hello [name] 主题:你好[姓名]

Message : How are you [name] ? 消息:你[名字]好吗? and some other text 和其他一些文字

I'm currently looping through the entire user collection to send the emails one at a time using Mailgun API and that's making 50k requests to mailgun server. 我目前正在遍历整个用户集合,以使用Mailgun API一次发送一封电子邮件,这向mailgun服务器发出了5万个请求。

Mailgun API does not allow multiple subject or body, what's the best approach to solving this problem? Mailgun API不允许多个主题或正文,解决此问题的最佳方法是什么? I don't mind switching from mailgun 我不介意从mailgun切换

You should use mailing lists feature: 您应该使用邮件列表功能:

A mailing list is a group of members (recipients) which itself has an email address, like developers@mailgun.net. 邮件列表是一组成员(收件人),其本身具有电子邮件地址,例如developers@mailgun.net。 This address becomes an ID for this mailing list. 该地址成为该邮件列表的ID。

Then you can add members to this list, and assign every member a name property and any other fields you'd like. 然后,您可以将成员添加到此列表,并为每个成员分配一个name属性以及您想要的任何其他字段。 After that recipient variables can be used to replace placeholders like %recipient.name% with a name of every contact automatically. 之后,可以使用收件人变量自动将占位符(如%recipient.name%替换为每个联系人的名字。

This feature is described in batch sending section of their docs, as well as another option that does not require to create a mailing list. 该功能在其文档的“ 批量发送”部分以及不需要创建邮件列表的另一个选项中进行了描述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM