Closed rendermusic closed 5 years ago
Did you try to this = "{ attributes.attributeName }, { params.attributeName }, { attributeName }" instead this "{{ attributes.attributeName }}, {{ params.attributeName }}, {{ attributeName }" ?
Hi @rendermusic
The API call Send a transactional email is used to send SendinBlue’s New Template Language Templates (which uses for ex {{ params.parameterNAME }}
for params
replacement), please refer our help doc
Wrapper link: https://developers.sendinblue.com/reference#sendtransacemail - https://github.com/sendinblue/APIv3-nodejs-library/blob/master/docs/SMTPApi.md#sendTransacEmail
Now the another API call Send a template which also says This endpoint is deprecated. Prefer v3/smtp/email instead.
is used to send SendinBlue’s Old Template Language Templates (which uses for ex %ORDER_AMOUNT%
for attributes
replacement), again please refer our help doc
Wrapper link: https://developers.sendinblue.com/reference#sendtemplate-1 - https://github.com/sendinblue/APIv3-nodejs-library/blob/master/docs/SMTPApi.md#sendTemplate
Thanks
same issue for me, here is my code:
const defaultClient = SibApiV3Sdk.ApiClient.instance;
const apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = config.SENDINBLUE.apiKey;
const apiInstance = new SibApiV3Sdk.SMTPApi();
await apiInstance.sendTemplate(myTemplateId, {
emailTo: [myEmail],
params: {
foo: 'bar',
},
});
here is my template: Value of foo: #{{ params.foo }}# Value of mail: #{{ contact.EMAIL }}#
here is the mail I receive:
Value of foo: ## Value of mail: #myEmail#
I'm a bit confused, I don't know what I'm doing wrong :/ Thx for your answer
Same problem here, Up !
was this fixed? I have same problem
sendTransacEmail with the 'params' key works fine. However, using sendTemplate with 'attributes' leaves {{ }} tokens blank in the final email.
Tried: {{ attributes.attributeName }}, {{ params.attributeName }}, {{ attributeName }} and all are left blank.