Skip to content

Commit 264bd6f

Browse files
Merged in r2-3181-email-punc (pull request #7080)
R2-3181: Fixing no-theme emails have orphan punctuation marks Approved-by: Pavel Nabutovsky
2 parents 22f92ad + 35e6095 commit 264bd6f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/models/theme.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def site_name
9090
end
9191

9292
def t(key, locale)
93-
data.dig(key, locale) || data.dig(key, I18n.locale.to_s) || ''
93+
data.dig(key, locale) || data.dig(key, I18n.default_locale.to_s) ||
94+
DEFAULT_THEME.dig(key, 'en') || ''
9495
end
9596

9697
def get(key, default_value = '')

app/views/layouts/mailer.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
style="font-size:0px;padding:10px 25px;word-break:break-word;">
177177
<div
178178
style="font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;font-size:18px;line-height:30px;text-align:left;color:#4a4a4a;">
179-
<p><i><%= @theme.t('email_closing', @locale) %>,</i></p>
179+
<p><i><%= @theme.t('email_closing', @locale) %></i></p>
180180
<p><b><%= @theme.t('email_signature', @locale) %></b></p>
181181
</div>
182182
</td>

config/locales/en.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4474,7 +4474,7 @@ en:
44744474
subject: 'Welcome to %{system}!'
44754475
subject_instructions: '%{system} Login Instructions'
44764476
greeting: 'Welcome to %{system}!'
4477-
body_native: "%{greeting}! We are creating a %{role_name} account for you. You will receive a separate email to set up your password shortly. Once logged in please go to your user profile to find your username. You will find your user profile in the left navigation of Primero."
4477+
body_native: "%{greeting} We are creating a %{role_name} account for you. You will receive a separate email to set up your password shortly. Once logged in please go to your user profile to find your username. You will find your user profile in the left navigation of Primero."
44784478
body_native2: "You can watch this %{instructional_video} if you need additional guidance."
44794479
instructional_video: instructional video
44804480
additional_support: 'Please contact your %{admin_email} if you need additional support.'
@@ -4558,6 +4558,6 @@ en:
45584558
email_disclaimer_pre: DO NOT REPLY TO THIS EMAIL
45594559
email_welcome_greeting: Welcome to the Primero team
45604560
email_welcome_closing: Welcome to the Primero Community
4561-
email_closing: At your service
4561+
email_closing: At your service,
45624562
email_signature: Primero team
45634563
email_admin_name: System Administrator

0 commit comments

Comments
 (0)