This started happening after I upgraded to v1.9.0.beta5 +30.
When I do a bulk invite from file, I change the Invite Forum Mailer text to be specific for that set of invitations. Then I change it back to a different text for single manual invites. This worked fine until I upgraded to the latest version.
Now what happens is that I change the Invite Forum Mailer and save it, and it looks like it saves ok. But when I actually send an invite it uses the old text, although when I look at the Invite Forum Mailer setting again, it appears to have the new text in it. If I do a bulk invite from file, then it sends out the old text and it resets the text in the Invite Forum Mailer custom text window to the previous version.
Anyone else have this issue or able to reproduce it?
Ok I think I’m making some progress with this. I removed all custom themes and plugins from my test install and the issue is still happening.
What I’ve found is that if you don’t include the variables %{invitee_name} and %{site_domain_name} in the Invite Forum Mailer subject line, then the template will not save properly and will revert to what it was before. If I go to the Text Context tab under Customize, and try to save a change to invite_forum_mailer.subject_template that doesn’t include both of those variables, I get the following error message:
The following interpolation key(s) are missing: “invitee_name, site_domain_name”
So what appears to be happening is that trying to save the Invite Forum Mailer template does a behind the scenes check to make sure those variables are in the subject line and if they aren’t there, the change does not save even though no error message is given.
Steps to reproduce:
Go to Settings->Customize->Email Templates
Select Invite Forum Mailer
Change the Subject to something that doesn’t include the necessary variables. For example just put in “test”
Save Changes
Exit the customization screen
Go back to Settings->Customize->Email Templates
Select Invite Forum Mailer
Note that the Subject changes back to the default of “%{invitee_name} invited you to join %{site_domain_name}”
If you attempt the above steps and make changes to the Subject that keep two required variables, the change will save properly. For example, change the Subject to “%{invitee_name} test %{site_domain_name}” and that change will save properly because the two variables are still in the Subject line.
Can you please try out the above procedure and let me know if you are able to reproduce it @techAPJ?
Also note that this behavior is new to this version. On previous versions of Discourse I was able to save any subject line without it requiring the variables in question.
a) Is this expected behavior (and if so can we get an error message)?
b) Why did this start happening on the latest version when it wasn’t before? Is this indeed a new feature? Or was it an old feature that wasn’t working properly and got fixed?
c) Can this be an optional check or a warning, as I’d like to be able to customize the text of the invite fully rather than being constrained to include those variables?
that re-enables the invalid interpolation keys check while reverting to the previous behavior where interpolation keys can be left out in customizations.
Custom interpolation keys that we secretly allow are whitelisted in a constant. The whitelist isn’t the best solution I’ve got but I think the invalid interpolation keys is more important to have as it protects users from creating an invalid translation override.