sendinblue / APIv3-python-library

SendinBlue's python library for API v3
MIT License
82 stars 40 forks source link

I can't send parameters in SendEmail () function #64

Closed NeftaliAcosta closed 3 years ago

NeftaliAcosta commented 3 years ago

I am trying to send transactional emails in Python through the client and using the sendEmail () method. Everything works, however, my template has parameters and I want to send them from the client, but they appear blank. What am I doing wrong?

`# create an instance of the API class api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration)) template_id = 196 # int | Id of the template

send_email = sib_api_v3_sdk.SendEmail( email_to = ["hola@jxxaocay.mx"], attributes = { "params.prospecto": "Carlos", "asesor": "Neftali Xaxaxaxa", "telefono": "22xxxx37090" } )

try:

Send a template

api_response = api_instance.send_template(template_id, send_email)
pprint(api_response)

except ApiException as e: print("Exception when calling TransactionalEmailsApi->send_template: %s\n" % e) `

thank you.

cyzanfar commented 3 years ago

How are you calling them in your template? for any non-contact params, it seems that you need to call them in your template via {{ params.asesor }}.

ruudy-sib commented 3 years ago

Hi @NeftaliAcosta Could you please try to use our latest method for sending transactional emails? It can be found here in our reference docs and you can select the Python tab in the code example. Please refer to the screenshot below: PythonExample

Please let us know if you still face any issue.

Thanks

ljmartinez1994 commented 2 years ago

{ "result": { "params": { "name": "ljmartinez", "code": "3f3047ea-b8f6-45d3-9ed4-5e7834f9371e", "email": "luisothegreat@gmail.com" } }, "statusCode": 200, "customStatusCode": 0 }

my api response is this, i am putting params.code and nothing

ulises-castro commented 2 years ago

@ljmartinez1994, you should modify your template

changing your %code% to {{ params.code }} in your template.

It sucks how send in blue's docs were made, it not pretty much clear about this BREAKING CHANGES...