This module allows you to manage which lists are assigned to marketing email.

add

Assign a List to a Marketing Email.

Parameter Required Requirements Description
list Yes None The name of the list to assign to the marketing email
name Yes None The name of the marketing email
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/recipients/add.json
POST Data name=SendGrid%20NL%20Test2&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/newsletter/recipients/add.xml
POST Data name=SendGrid%20NL%20Test2&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
<result>
   <message>success</message>
</result>

get

Get all lists assigned to a particular marketing email

Parameter Required Requirements Description
name Yes None The name of the marketing email for which to retrieve lists.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/recipients/get.json
POST Data name=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
[
  {
    "list": "Training Contacts"
  }
]

Call

POST https://api.sendgrid.com/api/newsletter/recipients/get.xml
POST Data name=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
<lists>
   <list>
      <list>Training Contacts</list>
   </list>
</lists>

delete

Remove assigned lists from marketing email

Parameter Required Requirements Description
name Yes Must be an existing marketing email To marketing email from which the list will be unassigned.
list Yes Must be an existing Recipient List. Remove this list from the marketing email
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/recipients/delete.json
POST Data name=SendGrid%20NL%20Test1&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/newsletter/recipients/delete.xml
POST Data name=SendGrid%20NL%20Test1&list=test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
<result>
   <message>success</message>
</result>