I suggest pushing attribute feature to send email via API
Currently, sending emails via API will send a fixed, available template. If my email template has dynamic parameters, it will not be possible to customize when sending via API.
I propose adding the attribute push and auto replace functions in the mail template to be able to pass dynamic parameters to the email template instead of fixed mail as it is now.
Very helpful suggestions, thank you. It will be added to the next release.
Has this been added? The docs makes it seem like this feature's been added: https://www.billionmail.com/start/api_mail_guide.html
However, I have a template which contains:
<p>Hey {{.API.first_name}} {{.API.last_name}},</p>
And try :
curl -k -X POST 'https://mail.example.com/api/batch_mail/api/send' -H 'X-API-Key: MYAPIKEY' -H 'Content-Type: application/json' -d '{
"recipient": "[email protected]",
"attribs": {
"first_name": "Jesse",
"last_name": "Jackson"
}
}'
But it doesn't work
Has this been added? The docs makes it seem like this feature's been added: https://www.billionmail.com/start/api_mail_guide.html
However, I have a template which contains:
<p>Hey {{.API.first_name}} {{.API.last_name}},</p>And try :
curl -k -X POST 'https://mail.example.com/api/batch_mail/api/send' -H 'X-API-Key: MYAPIKEY' -H 'Content-Type: application/json' -d '{ "recipient": "[email protected]", "attribs": { "first_name": "Jesse", "last_name": "Jackson" } }'But it doesn't work
@fraschm1998 Hey, can you tell me what you encountered? It's not sent email or variables not replaced?
@bt-dev3 The email was sent but the variables were not replaced:
@fraschm1998 That is confusing. I'm successful in replacing the variables in my testing. Are you using the latest release?
@fraschm1998 That is confusing. I'm successful in replacing the variables in my testing. Are you using the latest release?
What email template are you using for testing and what curl command?
I'm using V4.0
Edit: I figured it out.. If the email template contains any {{randomVariable}} alongside {{.API.randomVariable}} then it will ignore the {{.API.randomVariable}}
Edit2: Btw the title on the Template page is in Chinese
@fraschm1998 Very helpful information, we'll fix it in the next release, thank you.
However, I have a template which contains: