我想给邮件列表上的每个人发一些电子邮件。到目前为止,我的情况如下:
public function sendToListByListName($listName, $config, $vars)
{
//First we get the list ID from the list name stored in our local settings file.
if (array_key_exists($listName, $this->config['lists']) && $this->config['lists'][$listName] !== null) {
$listId = $this->config['lists'][$listName];
} else {
return false;
}
//TODO: Get the list email address (for example, tb10xdrjm@lists.mailjet.com) via a mailjet API call
$listAddress = '?? API CALL HERE ??';
//Now we use our sendEmailTo() method to send a group email to the list
return $this->sendEmailTo($listAddress, $config, $vars);
}( sendEmailTo()方法是一些同事已经定义的本地方法。他们目前正在用它向个人发送电子邮件。)
我仔细查看了mailjet文档,在找到将列表ID (比如12345)转换为它的等效地址(比如tb10xdrjm@lists.mailjet.com)时遇到了困难。我肯定它就在我面前。有人能帮忙吗?
发布于 2019-04-05 12:40:14
GET /contactslist/{list_ID or list_address}list_address显示在列表的Address属性中。完整的电子邮件地址将是{list_address}@lists.mailjet.com。可以用作list_ID的替代方案。
因此,如果使用list_ID查询此端点,您将得到一个列表地址,可以用作@lists.mailjet.com的前缀。
https://stackoverflow.com/questions/55534719
复制相似问题