# E-mail template limitations

**URL:** <https://community.auth0.com/t/e-mail-template-limitations/79903>\
**Category:** Get Help\
**Tags:** email, email-template, custom\
**Created:** [March 15, 2022, 12:55pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903 "2022-03-15T12:55:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![emiel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emiel/32/33674_2.png) [@emiel](https://community.auth0.com/u/emiel)\
**Post date:** [March 15, 2022, 12:55pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/1 "2022-03-15T12:55:31Z")

</div>

Hello,

At the moment we’re using the **Change Password** e-mail template in Auth0 with a bunch of (Liquid syntax) if-then-else-s to accomodate for e-mails that need to be send for different apps (defined as separate applications in Auth0, therefor having different _clientIds_).

Since a particular e-mail template can grow quite large with all the HTML and CSS required for different e-mail clients (G-mail, Outlook, whatever), this single template is also getting quite big.

So, let’s say we have three different public web apps (and therefor 3 applications defined in Auth0), our template consists of 3 concatenated HTML templates with some if-then-else structures where it shows or hides sections based on the `clientId`.

Two questions arise:

- What would be the limitation of the e-mail template? Is there a maximum number of characters the template is allowed to have?
- Would there be a possibility to split it up somehow across different templates or do we need to move away from using these templates and start using an external e-mail service (like Mandrill) to use their templating engine?

Kind regards,

Emiel

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 15, 2022, 10:57pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/2 "2022-03-15T22:57:21Z")

</div>

Hi @emiel,

> [@emiel](#):
>
> What would be the limitation of the e-mail template? Is there a maximum number of characters the template is allowed to have?

We don’t have a published maximum char limit, and I know some of our customers have very large templates. What you are describing sounds completely feasible.

> [@emiel](#):
>
> Would there be a possibility to split it up somehow across different templates or do we need to move away from using these templates and start using an external e-mail service (like Mandrill) to use their templating engine?

We don’t have a feature like this at the moment.

You can always create a [Feature Request](https://community.auth0.com/c/feedback/95), thanks!

---

<div class="post-metadata">

**Author:** ![emiel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emiel/32/33674_2.png) [@emiel](https://community.auth0.com/u/emiel)\
**Post date:** [March 16, 2022, 11:21am UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/4 "2022-03-16T11:21:52Z")

</div>

Thanks for your prompt answer @dan.woda .

Could you perhaps also point me in the right direction what would be needed to move away from using Templates inside Auth0 and start using an external e-mail service. We already are using Mandrill in the company. In fact, Auth0 is now connecting to that to use it as an SMTP service.

One question that was asked was if it would be possible to make localized e-mail templates. Since all variations of the template are in one big HTML currently, I’m not all too happy going down that rabbit hole.

I would reckon that it would incorporate using Actions or Rules calling into - in our case - the Mandrill API?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 16, 2022, 4:32pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/5 "2022-03-16T16:32:10Z")

</div>

> [@emiel](#):
>
> Could you perhaps also point me in the right direction what would be needed to move away from using Templates inside Auth0 and start using an external e-mail service.

This doc covers the things you described.

[https://auth0.com/docs/customize/email/manage-email-flow](https://auth0.com/docs/customize/email/manage-email-flow)

---

<div class="post-metadata">

**Author:** ![emiel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emiel/32/33674_2.png) [@emiel](https://community.auth0.com/u/emiel)\
**Post date:** [March 17, 2022, 9:45am UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/6 "2022-03-17T09:45:11Z")

</div>

Thanks again @dan.woda

One last thing I need to ask. The e-mail provider settings allow you to specify just one single _From_ e-mail address.

When sending different e-mails based on a single template (like we are using the _Change Password_ template), some customization is possible in there in the _From_ field.

Currently we’re using this construct to change the sender of the e-mail.

`{% if application.clientID == 'xyz' %} Application one {% else %} Fallback application {% endif %} <our@emailaddress.com>`

In the past, it was not possible to make the actual e-mail address dynamic.  
The following construct _was not working_ (not tested if it’s still not working)  
`{% if application.clientID == 'xyz' %} Application one <app1@email.com> {% else %} Fallback application <fallback@email.com> {% endif %}`.

Is there perhaps another way to work around this?

Kind regards

Emiel

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 17, 2022, 4:11pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/7 "2022-03-17T16:11:22Z")

</div>

> [@emiel](#):
>
> In the past, it was not possible to make the actual e-mail address dynamic.  
> The following construct _was not working_ (not tested if it’s still not working)  
> `{% if application.clientID == 'xyz' %} Application one <app1@email.com> {% else %} Fallback application <fallback@email.com> {% endif %}` .

I just tested it, and this seems to be working fine for me. To confirm, you are trying to add this conditional statement in the _From_ field of the template, correct?

---

<div class="post-metadata">

**Author:** ![emiel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emiel/32/33674_2.png) [@emiel](https://community.auth0.com/u/emiel)\
**Post date:** [March 17, 2022, 4:19pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/8 "2022-03-17T16:19:30Z")

</div>

Hi @dan.woda, yes! That’s correct!

Let me try it out again. So, to be clear, in the _E-mail Provider_ section you defined `email1@blah.com` (in our case it would be the _Mandrill Settings_)

![image](https://global.discourse-cdn.com/auth0/original/3X/d/d/dd896a70e963929933159081d6f690368c557334.png)

and in the template you can use `{% if application.clientID == 'xyz' %} Application one <email1@blah.com> {% else %} Fallback application <totally.different@email.com> {% endif %}` ?

I’m guessing Mandrill needs to be somehow configured to accept messages being relayed from this other domain as well?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [March 17, 2022, 4:29pm UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/9 "2022-03-17T16:29:34Z")

</div>

I’m using Mailgun, and it worked without having to register anything. The [Customize Email Templates](https://auth0.com/docs/customize/email/email-templates#configure-from-address) doc mention you may have to set up a [Sender Policy Framework - Wikipedia](https://en.wikipedia.org/wiki/Sender_Policy_Framework), but I’m not sure.

I would just test it and see the result. Let me know! 😃

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 11:37am UTC](https://community.auth0.com/t/e-mail-template-limitations/79903/10 "2022-12-22T11:37:57Z")

</div>


