Mandrill template variables do not replace

Issue with template variables does not replace when sending email. I have a simple template:

<div class="entry"> Your name is {{firstName}} </div>

And my Python code to send email:

client = mandrill.Mandrill(apikey=api_key)

my_merge_vars = [{'content': 'Dexter', 'name': 'firstName'}]
message = {'from_email': 'addr1@gmail.com',
       'to': [{'email': 'addr2@gmail.com',
               'name': 'Deborah',
               'type': 'to'}
       ],
       'subject': 'example subject',
       'global_merge_vars': my_merge_vars

}
result = client.messages.send_template(template_name='test-template',
                          template_content=[],
                          message=message)

The letter is sent, but I get: Your name is {{firstName}}

+4
source share
1 answer

Make sure you indicate that the type of merge is rudders. You can do this in your account settings (Settings> Default sending> Combine language) or in the API call through the "merge_language" parameter.

+9
source

All Articles