0

Please how can I add custom placeholder to the portal editor for infobip email service.

I have created a template with the portal design editor and I want to dynamically add placeholders like the recipients first name or the recipients and invoice ID or any other necessary data concerning the recipient, I'm trying to create an invoice email for my customers.


From the API documentation, I have seen the place to pass in the template ID but I'm not seeing any place where I can pass in my own custom variables for the custom recipient data. so please help if there is any and thanks.

Vixson
  • 589
  • 7
  • 8

2 Answers2

2

Easiest way would be to define placeholders in the template you save. Like this: {{customer_name}} {{invoice_no}} and then when you use the template Id in API request you would have to send via API something like this:

curl --location --request POST 'https://api.infobip.com/email/2/send' \
--header 'Authorization: Basic Authorization==' \
--form 'templateID="Your_template_id"' \
--form 'to="{
  \"to\": \"Customer1@customer1.com\",
  \"placeholders\": {
    \"customer_name\": \"Customer 1\",
    \"invoice_no\": \"1\"
  }
}

"' \
--form 'to="{  
  \"to\": \"customer2@gmail.com\",
  \"placeholders\": {
    \"customer_name\": \"*customer 2\",
    \"invoice_no\": \"2\"
  }
}"'
0

I have been using as EmailJs before. Their integration is extremely simple and straight forward.

Vixson
  • 589
  • 7
  • 8