# Changes to email templates not saving

**URL:** https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691
**Category:** Bug
**Created:** [9월 25, 2017, 1:19오전 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691 "2017-09-25T01:19:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [9월 25, 2017, 1:19오전 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/1 "2017-09-25T01:19:17Z")

</div>

I have a report of someone that has been trying to update their email templates but the changes are not saving.

So far it has happened with both the Account Created and the Invite Mailer templates.

When they click “Save Changes” the “Saved!” message is returned but the changes are lost when the screen is refreshed.

It is happening in both Firefox and Safari.

I can’t repro it here or on [try.discourse.org](http://try.discourse.org), but @erlend_sh didn’t you deal with the same thing last week?

---

<div class="post-metadata">

### Author: ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)
#### Post date: [9월 25, 2017, 5:40오전 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/2 "2017-09-25T05:40:09Z")

</div>

some similar issues here:

> [@Bug: changing the email subject for some templates is ignored](https://meta.discourse.org/t/bug-changing-the-email-subject-for-some-templates-is-ignored/60305):
>
> I changed the subject for the “User Posted PM” email template to [%{email\_prefix}] [PM] %{username} sent you a private message but it is ignored and is still using [%{email\_prefix}] [PM] %{topic\_title} Using 1.8.0.beta9. Editing other email template subject lines seems to work, this one is ignored. Also, the line To unsubscribe from these emails, click here. is always added at the end of the message, regardless of what I put in the template body. Can we fix that too and allow us to change it (…

[https://meta.discourse.org/t/translation-of-email-templates-does-not-get-saved-if/65204?u=pad\_pors](https://meta.discourse.org/t/translation-of-email-templates-does-not-get-saved-if/65204)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [9월 25, 2017, 10:28오전 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/3 "2017-09-25T10:28:20Z")

</div>

> [@HAWK](#):
>
> didn’t you deal with the same thing last week?

Yeah, I’ve encountered this and received some reports about it. I think I was able to reproduce once and then it was seemingly working again.

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [9월 25, 2017, 4:22오후 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/4 "2017-09-25T16:22:38Z")

</div>

@jomaxro Will you please see if you can repro it when you get a sec?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [9월 25, 2017, 4:24오후 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/5 "2017-09-25T16:24:38Z")

</div>

If I’m not mistaken @erlend_sh repro’d this the other day. Will add to my list.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 26, 2017, 2:44오전 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/7 "2017-09-26T02:44:27Z")

</div>

We need this bug fixed, @gerhard can you have a look?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [9월 27, 2017, 9:40오후 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/9 "2017-09-27T21:40:18Z")

</div>

I fixed this today. You should get an error when you try to save an email template with missing interpolation keys.

[https://github.com/discourse/discourse/commit/1a378126259b1461bb935d1385778842d33b088a](https://github.com/discourse/discourse/commit/1a378126259b1461bb935d1385778842d33b088a)

Bonus: Changing an email template will create an entry in the Staff Log. That didn’t happen before.

While testing this I also noticed that reverting changes to an email template or site text can result in a “translation missing” error. I think I found a [solution for that](https://github.com/discourse/discourse/pull/5208) as well, but I’m not comfortable merging it in until someone else from the team takes a look at it.

@Pad_Pors Unfortunately it’s currently not possible to omit interpolation keys.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [9월 29, 2017, 9:40오후 UTC](https://meta.discourse.org/t/changes-to-email-templates-not-saving/70691/10 "2017-09-29T21:40:29Z")

</div>

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