Send mail to contact list
Hi,
I am currently using a template which i pass my variables. Is it possible to send contact list instead of individual emails? using send endpoint?
Also i noticed on campaign end point (https://api.mailjet.com/v3/REST/campaigndraft) you can pass in templateID which i do
{
"EditMode":"tool2",
"TemplateID":"1051525",
"ContactsListID":"10240600",
"Locale":"en_US",
"Sender":"6453733311",
"SenderEmail":"[email protected]"
}
but then how do i pass my variables to this campaign? Thanks
Hi @ergunp ,
It is indeed possible to send to a contact list via the Send API.
Every contact list you create has its own unique email address, which can be used to send emails to all contacts subscribed to it. You can retrieve the address with a GET on /contactslist/{list_id} - you'll get a response like this:
{
"Count": 1,
"Data": [
{
"Name": "my_contactslist",
"Address": "abcdef123",
"CreatedAt": "2018-01-01T00:00:00",
"ID": 123456,
"SubscriberCount": 111
}
],
"Total": 1
}
The Address property is what you need. The full address will be {address}@lists.mailjet.com, so in this case [email protected]. Also don't worry, recipients will only be able to see their own email address; all the other email addresses are hidden.
Regarding /campaigndraft - no, it's not possible to pass variables through it. You will still be able to use contact properties, though, as those will be pulled automatically from the data already stored in Mailjet.
Regards, Atanas
@adamyanliev Thanks, I will take a look into this.
@ergunp Seems like answered, going to close this if you don't mind.