Yes, you can absolutely personalize emails!
On the design page, click within any text box and then place your cursor where you want to add the personalized text. Next, click on Variables from the menu.
Select the
Type of variable ("
Custom transactional variable") and then enter a Variable name. This variable name will need to correspond to one of the variables that you use in the
X-Mailgun-Variables parameter of your
API request (see the hyperlinked text for full details on using the Mailgun Templates API along with the Messages API). For example, you could enter the
Variable name “firstname”.
With the variable of "firstname" configured in the template, you'll see the {{firstname}} placeholder in the selected text box:
Using a different example, below is what the recipient of the email ("Ruby") would see in her mailbox:
The value "Ruby" is supplied to the "firstname" variable within the API request submitted to Mailgun. Here's an example of the cURL request that assigns the value "Ruby" to the variable "firstname".
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \
-F from='A1 Car Rental <rental@YOUR_DOMAIN_NAME>' \
-F to='ruby.test@example.com' \
-F subject='Biggest Discounts Of The Year!!!' \
-F template='template.test' \
-F t:variables='{"firstname": "Ruby"}'
Got Questions?
Mailgun by Sinch has answers! If you have any concerns or questions, please send us a Support ticket using the Support page within your Mailgun Control Panel. Our Support Team will be happy to assist!