diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 56593fe8aaa..acf82ae2dc0 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -4,6 +4,7 @@ require_dependency 'age_words' class UserNotifications < ActionMailer::Base include UserNotificationsHelper + include ApplicationHelper helper :application default charset: 'UTF-8' @@ -117,7 +118,7 @@ class UserNotifications < ActionMailer::Base .for_mailing_list(user, min_date) .where('posts.post_type = ?', Post.types[:regular]) .where('posts.deleted_at IS NULL AND posts.hidden = false AND posts.user_deleted = false') - .where("posts.post_number > ? AND posts.score > ?", 1, ScoreCalculator.default_score_weights[:like_score] * 5.0) + .where("posts.post_number > ? AND posts.score > ?", 1, ScoreCalculator.default_score_weights[:like_score] * 1.0) .limit(SiteSetting.digest_posts) else [] @@ -399,7 +400,7 @@ class UserNotifications < ActionMailer::Base invite_template = "user_notifications.invited_to_topic_body" end topic_excerpt = post.excerpt.tr("\n", " ") if post.is_first_post? && post.excerpt - message = I18n.t(invite_template, username: username, topic_title: title, topic_excerpt: topic_excerpt, site_title: SiteSetting.title, site_description: SiteSetting.site_description) + message = I18n.t(invite_template, username: username, topic_title: gsub_emoji_to_unicode(title), topic_excerpt: topic_excerpt, site_title: SiteSetting.title, site_description: SiteSetting.site_description) unless translation_override_exists html = UserNotificationRenderer.new(Rails.configuration.paths["app/views"]).render( @@ -434,7 +435,7 @@ class UserNotifications < ActionMailer::Base end email_opts = { - topic_title: title, + topic_title: gsub_emoji_to_unicode(title), topic_title_url_encoded: title ? URI.encode(title) : title, message: message, url: post.url, diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index 6cee3a4e7ed..44c83df06c8 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -124,7 +124,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

- <%= t.title.truncate(60, separator: /\s/) -%> + <%= gsub_emoji_to_unicode(t.title.truncate(60, separator: /\s/)) -%>

<%- if SiteSetting.show_topic_featured_link_in_digest && t.featured_link %> @@ -279,7 +279,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo

- <%= post.topic.title.truncate(60, separator: /\s/) -%> + <%= gsub_emoji_to_unicode(post.topic.title.truncate(60, separator: /\s/)) -%>

<%=t 'user_notifications.digest.join_the_discussion' %> @@ -325,7 +325,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo - <%= t.title.truncate(60, separator: /\s/) -%> + <%= gsub_emoji_to_unicode(t.title.truncate(60, separator: /\s/)) -%> <%- if SiteSetting.show_topic_featured_link_in_digest && t.featured_link %> <%= raw topic_featured_link_domain(t.featured_link) %>