How can i delete a contact from a list with the mailjet api and php? [closed]

故事扮演 提交于 2019-12-11 22:58:53

问题


I use mailjet api to send newsletter, but i don't know how delete a contact from a list.

Please help me.


回答1:


I'm a developer evangelist here at Mailjet.

The relation between a contactlist and a contact is represented through the listrecipient entity. You can learn more about this in our guide, here:

To remove a contact from a list, you have two options: either DELETE this entity or unsubscribe the contact from the list. The second solution has the advantage to keep the contact's status in the list. It prevents to send unwanted emails to a contact, if for some reason you add it in the list again later.

First, do a GET request to retrieve the ID of the listrecipient entity. As described in our reference documentation, here, use the Contact and ContactsList filter. Once you have the ID, you can either run a DELETE request on it to permanently delete the contact in the list or set the IsUnsubscribed property to true to unsubscribe it.



来源:https://stackoverflow.com/questions/26914720/how-can-i-delete-a-contact-from-a-list-with-the-mailjet-api-and-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!