You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix missing org name (short and long) in email templates (#4638)
I noticed that the signature of the application notification emails was
off:
```
Kind Regards,
The Team
--
http://example.com
```
While investigating I found out that the `base.html` email template was
using `org_long_name` instead of `ORG_LONG_NAME` (which is what the
`global_vars` [context
processor](https://github.com/HyphaApp/hypha/blob/d26405a02bf8ef8ac348992c3a12f6c100f82bab/hypha/core/context_processors.py#L6)
is providing).
This issue appears to be widespread, and it's not helped by the fact
that some emails correctly receive the `org_long_name` variable (it's
passed manually in the context).
For this PR, I went with the exhaustive approach of replacing every
single instance of `org_long_name`, `org_short_name`, and `org_email`
with their uppercase counterparts:
```
git grep -lw org_long_name | xargs sed -i 's/\borg_long_name\b/ORG_LONG_NAME/'
git grep -lw org_short_name | xargs sed -i 's/\borg_short_name\b/ORG_SHORT_NAME/'
git grep -lw org_email | xargs sed -i 's/\borg_email\b/ORG_EMAIL/'
```
Copy file name to clipboardExpand all lines: hypha/apply/users/templates/users/activation/email.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{% load i18n wagtailadmin_tags %}{% base_url_setting as base_url %}{% firstof name username as user %}
2
2
{% blocktrans %}Dear {{ user }},{% endblocktrans %}
3
3
4
-
{% blocktrans %}Activate your account on the {{ org_long_name }} web site by clicking this link or copying and pasting it to your browser:{% endblocktrans %}
4
+
{% blocktrans %}Activate your account on the {{ ORG_LONG_NAME }} web site by clicking this link or copying and pasting it to your browser:{% endblocktrans %}
5
5
6
6
{% if site %}{{ site.root_url }}{% else %}{{ base_url }}{% endif %}{{ activation_path }}
7
7
@@ -15,8 +15,8 @@
15
15
{% blocktrans %}If you do not complete the activation process within {{ timeout_days }} days you can use the password reset form at{% endblocktrans %}: {% if site %}{{ site.root_url }}{% else %}{{ base_url }}{% endif %}{% url 'users:password_reset' %}
16
16
17
17
{% blocktrans %}Kind Regards,
18
-
The {{ org_short_name }} Team{% endblocktrans %}
18
+
The {{ ORG_SHORT_NAME }} Team{% endblocktrans %}
19
19
20
20
--
21
-
{{ org_long_name }}
21
+
{{ ORG_LONG_NAME }}
22
22
{% if site %}{{ site.root_url }}{% else %}{{ base_url }}{% endif %}
0 commit comments