mailin-api/mailin-api-php

Possible issue using Transactional email (templates)

Closed this issue · 1 comments

garmr commented

Hello,
it looks like both send_transactional_template and update_template functions issue a PUT to https://api.sendinblue.com/v2.0/template/ and are updating the template passed as argument.

If I issue a curl request like this one :
url -H 'api-key:<my API key>' -X PUT -d '{"to":"a@b.com","from":"a@b.com","replyto":"a@b.com","subject":"My subject","attr":{"CIV":"Mister X","AMOUNT1":"416","AMOUNT2":25},"headers":{"Content-Type":"text\/html; charset=iso-8859-1","X-Mailin-Tag":"My TAG"}}' 'https://api.sendinblue.com/v2.0/template/6'

The webservice returns response
{"code":"success","message":"Updated the Template.","data":[]}

I probably missing something but I am not able to use send_transactional_template as described in the official documentation.

Thank in advance for your precious help.

garmr commented

Ok, I juste have a response from your support ( sorry about the duplicate ... ), the issue was happening because I was redefining some parameters already defined in my template.
For my particular case it was 'subject' and 'from'.

Here is the correct request :

url -H 'api-key:<my API key>' -X PUT -d '{"to":"a@b.com","replyto":"a@b.com","attr":{"CIV":"Mister X","AMOUNT1":"416","AMOUNT2":25},"headers":{"Content-Type":"text\/html; charset=iso-8859-1","X-Mailin-Tag":"My TAG"}}' 'https://api.sendinblue.com/v2.0/template/6

Sorry about the "noise" !
Cheers,