<p>I found the solution in the supplementary documentation here:<br />
<a href="https://supergeekery.com/blog/craftcms-html-email-template-missing-documenation" rel="nofollow noreferrer">Supergeekery - CraftCMS HTML Email Template Missing Documentation</a></p>
<p>In Craft CMS 5, you can indeed override the default system messages without modifying them directly in the Control Panel or database. Instead of relying on the content from <code>/admin/utilities/system-messages</code>, you can customize the email templates by switching based on the email type (<code>emailKey</code>).</p>
<p>To do this, add the following switch block to your email template:</p>
<pre><code>{% switch emailKey %}
    {% case &quot;account_activation&quot; %}
    &lt;p&gt;{{ &quot;You're activating your email.&quot; | t }}&lt;/p&gt;
    {% case &quot;verify_new_email&quot; %}
    &lt;p&gt;{{ &quot;Let's verify your new email address.&quot; | t }}&lt;/p&gt;
    {% case &quot;forgot_password&quot; %}
    &lt;p&gt;{{ &quot;Don't worry, we'll reset that password now.&quot; | t }}&lt;/p&gt;
    {% case &quot;test_email&quot; %}
    &lt;p&gt;{{ &quot;Testing makes perfect.&quot; | t }}&lt;/p&gt;
    {% default %}
    {{ body }}
{% endswitch %}
{{ body }}
</code></pre>
<p>However, instead of hardcoding the text like this, you can include the templates you've already created in your <code>/templates/email/</code> folder:</p>
<pre><code>{% switch emailKey %}
    {% case &quot;account_activation&quot; %}
    {% include &quot;email/account-activation.twig&quot; %}
    {% case &quot;verify_new_email&quot; %}
    {% include &quot;email/email-verification.twig&quot; %}
    {% case &quot;forgot_password&quot; %}
    {% include &quot;email/password-reset.twig&quot; %}
    {% case &quot;test_email&quot; %}
    {% include &quot;email/test-email.twig&quot; %}
    {% default %}
    {{ body}}
{% endswitch %}
{{ body }}
</code></pre>
<p>This approach allows you to fully customize the content of system messages outside of the database by utilizing template files, and it also supports multi-language setups.</p>

CC BY-SA 4.0
2024-09-20T09:31:51.870Z
2024-09-20T09:31:51.870Z
Romain P.
<p>You could create your own fields (as Globals) and refer to them in your templates.</p>
<p>This way (after setting the Translation Method for each field) you get translations out of the box and can set different messages for each site.</p>

CC BY-SA 4.0
2024-08-28T14:45:03.353Z
The issue here is that Craft is still fetching the encoded content from `/admin/utilities/system-messages` (i.e., from the database) instead of retrieving the custom templates.
Romain P.
CC BY-SA 4.0
2024-08-28T12:17:59.677Z
2024-08-28T12:17:59.677Z
J1989
<p>In Craft CMS 5, is there a way to customize the content of system messages outside of the Control Panel (under <code>/admin/utilities/system-messages</code>)?</p>
<p>I’m working on a multi-language site and would like to avoid having to update message content directly in the database.</p>
<p>I attempted to create the following templates:</p>
<ul>
<li><code>/templates/email/password-reset.twig</code></li>
<li><code>/templates/email/account-activation.twig</code></li>
<li><code>/templates/email/email-verification.twig</code></li>
</ul>
<p>However, Craft still seems to be pulling the content from the database rather than these template files.</p>
<p>Is there a way to override the system messages to use these templates instead? Any guidance would be greatly appreciated.</p>

<control-panel><emails>
Customizing System Messages via Templates Instead of the Control Panel
# Customizing System Messages via Templates Instead of the Control Panel

(Asked by: username_0 on 2024-08-26)

In Craft CMS 5, is there a way to customize the content of system messages outside of the Control Panel (under `/admin/utilities/system-messages`)?

I’m working on a multi-language site and would like to avoid having to update message content directly in the database.

I attempted to create the following templates:

* `/templates/email/password-reset.twig`
* `/templates/email/account-activation.twig`
* `/templates/email/email-verification.twig`

However, Craft still seems to be pulling the content from the database rather than these template files.

Is there a way to override the system messages to use these templates instead? Any guidance would be greatly appreciated.

**Tags:** control-panel, emails

---

## 2 answers

### Answer by username_0 on 2024-09-20. Score: 0 | Accepted answer

I found the solution in the supplementary documentation here:
Supergeekery - CraftCMS HTML Email Template Missing Documentation
In Craft CMS 5, you can indeed override the default system messages without modifying them directly in the Control Panel or database. Instead of relying on the content from /admin/utilities/system-messages, you can customize the email templates by switching based on the email type (emailKey).
To do this, add the following switch block to your email template:
{% switch emailKey %}
    {% case "account_activation" %}
    {{ "You're activating your email." | t }}
    {% case "verify_new_email" %}
    {{ "Let's verify your new email address." | t }}
    {% case "forgot_password" %}
    {{ "Don't worry, we'll reset that password now." | t }}
    {% case "test_email" %}
    {{ "Testing makes perfect." | t }}
    {% default %}
    {{ body }}
{% endswitch %}
{{ body }}

However, instead of hardcoding the text like this, you can include the templates you've already created in your /templates/email/ folder:
{% switch emailKey %}
    {% case "account_activation" %}
    {% include "email/account-activation.twig" %}
    {% case "verify_new_email" %}
    {% include "email/email-verification.twig" %}
    {% case "forgot_password" %}
    {% include "email/password-reset.twig" %}
    {% case "test_email" %}
    {% include "email/test-email.twig" %}
    {% default %}
    {{ body}}
{% endswitch %}
{{ body }}

This approach allows you to fully customize the content of system messages outside of the database by utilizing template files, and it also supports multi-language setups.


---

### Answer by username_1 on 2024-08-28. Score: -1

You could create your own fields (as Globals) and refer to them in your templates.

This way (after setting the Translation Method for each field) you get translations out of the box and can set different messages for each site.

> **Comments:**
> **username_0**: The issue here is that Craft is still fetching the encoded content from `/admin/utilities/system-messages` (i.e., from the database) instead of retrieving the custom templates.  

---

