# Dynamic update of email templates for different client id's

**URL:** <https://community.auth0.com/t/dynamic-update-of-email-templates-for-different-client-ids/136771>\
**Category:** Get Help\
**Tags:** emails, management-api\
**Created:** [June 21, 2024, 4:51am UTC](https://community.auth0.com/t/dynamic-update-of-email-templates-for-different-client-ids/136771 "2024-06-21T04:51:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mansi.srivastava](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mansi.srivastava/32/57793_2.png) [@mansi.srivastava](https://community.auth0.com/u/mansi.srivastava)\
**Post date:** [June 21, 2024, 4:51am UTC](https://community.auth0.com/t/dynamic-update-of-email-templates-for-different-client-ids/136771/1 "2024-06-21T04:51:18Z")

</div>

![auth0-emailtemplate](https://global.discourse-cdn.com/auth0/original/3X/e/9/e997e51db9aec8fb93770af8761570abd38061b9.jpeg)  
We have a requirement where we need a provision to update email templates from the web portal for which we are utlizing Auth0 API - PUT /api/v2/email-templates/{templateName}.

Our Auth0 tenant can have more than one applications and we want to update template based on client id of the application and for others preserve the default behaviour.

After executing the API, I can see it replaces the entire body. Do we have any solution for this where it replaces only that part of html for that specific client id

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [June 25, 2024, 1:29pm UTC](https://community.auth0.com/t/dynamic-update-of-email-templates-for-different-client-ids/136771/2 "2024-06-25T13:29:57Z")

</div>

Hi @mansi.srivastava ,

I think what you want to achieve is to conditionally work with the specific HTML tags instead of replacing the whole `<html> ...</html>` with your custom code once the condition is met.

Let’s say a user is resetting their password and for the application.clientID = ‘xyz’ you want the email to contain a sentence: “Please click the below link to reset your password” while for all the other applications you want to leave the already existing sentence unchanged.

Then you would edit the existing HTML script only in its relevant part (the relevant` <p>...</p>` tag).

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/9/59dcdbf3b4b512adb3323cfb9e872de92a8e279b.png)

```auto
<p>
{% if application.clientID=='xyz' %} 
Please click the below link to reset your password.
{% else %}
If it wasn't you please disregard this email and make sure you can still login to your account. If it
                was you, then <strong>confirm the password change <a href="{{ url }}">click here</a></strong
                >
{% endif %}
</p>

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 10, 2024, 10:46am UTC](https://community.auth0.com/t/dynamic-update-of-email-templates-for-different-client-ids/136771/4 "2024-07-10T10:46:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
