Update email template
Purpose
This API is used to edit your existing templates.
Request URL
Method : PUT
https://api.zeptomail.com/v1.1/mailagents/{mailagent-alias}/templates/{template-key}
OAuth scope
Any one of the following scopes can be used to access this API
scope=Zeptomail.MailTemplates.All
or
scope=Zeptomail.MailTemplates.UPDATE
ALL - This will give the basic CRUD access too all the email templates APIs.
The steps to generate and use OAuth token can be found here.
Path parameters
Parameter | Type | Description |
mailagent-alias | String | Unique alias value given to the Mail Agent. It is available in the Setup info section of your Mail Agent. |
Request body
Parameter | Type | Description |
template_name* | String | Name of the template |
template_alias | String | Unique alias for the template that can be used instead of template key while sending emails using Template API. It can be obtained from the Edit template section in your ZeptoMail account. |
subject* | String | Subject to be added in the email template. |
htmlbody** | String | The corresponding HTML content of the body in the email template. |
textbody** | String | Plain text body of the email in the template. |
*-Mandatory parameter
**-Atleast one of them is mandatory.
Sample request
Copiedcurl "https://api.zeptomail.com/v1.1/mailagents/{mailagent-alias}/templates/{{template-key}}\"
-X PUT
-H "Authorization : Zoho-oauthtoken ***"\
-H "Content-Type : application/json" \
-d '{
"template_name": "E-invite (new)",
"subject": "Email invitation",
"htmlbody": "<h1> Hi {{name}}</h1>, invitation link {{link}}",
}'
Sample response
Copied{
"data": [
{
"htmlbody": "<h1> Hi {{name}}</h1>, invitation link {{link}}",
"upload_time": "19 Sep 2022 11:32 AM",
"template_name": "E-invite(new)",
"template_key": "ea***607",
"template_size": 16,
"modified_time": "19 Sep 2022 11:32 AM",
"subject": "Email invitation"
}
],
"message": "OK",
"object": "templates"
}