diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb index 4c088836d11..84b5204f841 100644 --- a/app/helpers/user_notifications_helper.rb +++ b/app/helpers/user_notifications_helper.rb @@ -70,4 +70,16 @@ module UserNotificationsHelper PrettyText.format_for_email(html, post).html_safe end + def digest_custom_html(position_key) + digest_custom "user_notifications.digest.custom.html.#{position_key}" + end + + def digest_custom_text(position_key) + digest_custom "user_notifications.digest.custom.text.#{position_key}" + end + + def digest_custom(i18n_key) + PrettyText.format_for_email(I18n.t(i18n_key)).html_safe + end + end diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index d70c1189c6b..d8b7faf7bd1 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -1,5 +1,10 @@
+ <%= raw(t 'user_notifications.digest.custom.html.header') %> + | + <%- else %><%- if logo_url.blank? %> @@ -9,6 +14,7 @@ <%- end %> | + <%- end %>
@@ -32,11 +38,15 @@
<%- end %>
+ <%= digest_custom_html("below_post_#{i+1}") %>
+
<%- if i < @featured_topics.size - 1 %><% end %>
<%- end %>
<%- end %>
+ <%= digest_custom_html("above_popular_topics") %>
+
<%- if @new_topics.present? %>
<%=t 'user_notifications.digest.other_new_topics' %>@@ -53,6 +63,8 @@ <%- end -%> + <%= digest_custom_html("below_popular_topics") %> + <%- if @new_topics_since_seen > 0 %> <%- if @new_by_category.present? %><%= t('user_notifications.digest.more_topics_category', last_seen_at: @last_seen_at, new_topics_since_seen: @new_topics_since_seen) %> @@ -71,8 +83,12 @@ |