diff --git a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb index 24ec30105..fcd604344 100644 --- a/app/assets/javascripts/initializers/initializeCommentsPage.js.erb +++ b/app/assets/javascripts/initializers/initializeCommentsPage.js.erb @@ -1,5 +1,3 @@ - - function initializeCommentsPage() { if (document.getElementById('comments-container')) { toggleCodeOfConduct(); diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4328f02ce..d88301e16 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -194,7 +194,7 @@ module ApplicationHelper URL.reaction(reaction) end - def tag_url(tag, page) + def tag_url(tag, page = 1) URL.tag(tag, page) end diff --git a/app/helpers/feedback_messages_helper.rb b/app/helpers/feedback_messages_helper.rb index a08ae5332..817ff6dae 100644 --- a/app/helpers/feedback_messages_helper.rb +++ b/app/helpers/feedback_messages_helper.rb @@ -40,6 +40,6 @@ module FeedbackMessagesHelper DEV Team HEREDOC - { subject: "Courtesy Notice from DEV", body: body }.freeze + { subject: "Courtesy Notice from #{ApplicationConfig['COMMUNITY_NAME']}", body: body }.freeze end end diff --git a/app/labor/assign_tag_moderator.rb b/app/labor/assign_tag_moderator.rb index 832bf34ee..7908cb27a 100644 --- a/app/labor/assign_tag_moderator.rb +++ b/app/labor/assign_tag_moderator.rb @@ -17,7 +17,7 @@ module AssignTagModerator add_tag_mod_role(user, tag) add_trusted_role(user) add_to_chat_channels(user, tag) - NotifyMailer.tag_moderator_confirmation_email(user, tag.name).deliver unless tag.name == "go" + NotifyMailer.tag_moderator_confirmation_email(user, tag).deliver unless tag.name == "go" end end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index b9f17a5f9..2d9d847c0 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,9 +1,13 @@ class ApplicationMailer < ActionMailer::Base layout "mailer" + # the order of importing the helpers here is important + # we want the application helpers to override the Rails route helpers should there be a name conflict + # an example is the user_url + helper Rails.application.routes.url_helpers helper ApplicationHelper default( - from: -> { "DEV Community <#{SiteConfig.default_site_email}>" }, + from: -> { "#{ApplicationConfig['COMMUNITY_NAME']} Community <#{SiteConfig.default_site_email}>" }, template_path: ->(mailer) { "mailers/#{mailer.class.name.underscore}" }, ) diff --git a/app/mailers/digest_mailer.rb b/app/mailers/digest_mailer.rb index 420a9662d..c4adf0bdc 100644 --- a/app/mailers/digest_mailer.rb +++ b/app/mailers/digest_mailer.rb @@ -1,5 +1,5 @@ class DigestMailer < ApplicationMailer - default from: -> { "DEV Digest <#{SiteConfig.default_site_email}>" } + default from: -> { "#{ApplicationConfig['COMMUNITY_NAME']} Digest <#{SiteConfig.default_site_email}>" } def digest_email(user, articles) @user = user @@ -25,26 +25,27 @@ class DigestMailer < ApplicationMailer end def email_end_phrase + community_name = ApplicationConfig["COMMUNITY_NAME"] # "more trending DEV posts" won the previous split test # Included more often as per explore-exploit algorithm [ - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", - "more trending DEV posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", + "more trending #{community_name} posts", "other posts you might like", - "other DEV posts you might like", - "other trending DEV posts", - "other top DEV posts", - "more top DEV posts", + "other #{community_name} posts you might like", + "other trending #{community_name} posts", + "other top #{community_name} posts", + "more top #{community_name} posts", "more top reads from the community", - "more top DEV posts based on your interests", - "more trending DEV posts picked for you", + "more top #{community_name} posts based on your interests", + "more trending #{community_name} posts picked for you", ].sample end end diff --git a/app/mailers/notify_mailer.rb b/app/mailers/notify_mailer.rb index 4ec716140..343fdfbd9 100644 --- a/app/mailers/notify_mailer.rb +++ b/app/mailers/notify_mailer.rb @@ -1,6 +1,6 @@ class NotifyMailer < ApplicationMailer SUBJECTS = { - new_follower_email: "just followed you on dev.to".freeze + new_follower_email: "just followed you on #{ApplicationConfig['COMMUNITY_NAME']}".freeze }.freeze def new_reply_email(comment) @@ -40,7 +40,7 @@ class NotifyMailer < ApplicationMailer @unread_notifications_count = NotificationCounter.new(@user).unread_notification_count @unsubscribe = generate_unsubscribe_token(@user.id, :email_unread_notifications) - subject = "๐Ÿ”ฅ You have #{@unread_notifications_count} unread notifications on dev.to" + subject = "๐Ÿ”ฅ You have #{@unread_notifications_count} unread notifications on #{ApplicationConfig['COMMUNITY_NAME']}" mail(to: @user.email, subject: subject) end @@ -94,14 +94,14 @@ class NotifyMailer < ApplicationMailer def account_deleted_email(user) @name = user.name - subject = "dev.to - Account Deletion Confirmation" + subject = "#{ApplicationConfig['COMMUNITY_NAME']} - Account Deletion Confirmation" mail(to: user.email, subject: subject) end def account_deletion_requested_email(user, token) @name = user.name @token = token - subject = "dev.to - Account Deletion Requested" + subject = "#{ApplicationConfig['COMMUNITY_NAME']} - Account Deletion Requested" mail(to: user.email, subject: subject) end @@ -112,10 +112,10 @@ class NotifyMailer < ApplicationMailer mail(to: @user.email, subject: "The export of your content is ready") end - def tag_moderator_confirmation_email(user, tag_name) - @tag_name = tag_name + def tag_moderator_confirmation_email(user, tag) + @tag = tag @user = user - subject = "Congrats! You're the moderator for ##{tag_name}" + subject = "Congrats! You're the moderator for ##{@tag.name}" mail(to: @user.email, subject: subject) end diff --git a/app/views/chat_channels/index.html.erb b/app/views/chat_channels/index.html.erb index 4bb695654..478347873 100644 --- a/app/views/chat_channels/index.html.erb +++ b/app/views/chat_channels/index.html.erb @@ -1,6 +1,6 @@ <% title("#{community_name} Connect ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ’ฌ๐Ÿ‘จโ€๐Ÿ’ป") %> <%= content_for :page_meta do %> - " /> + <% end %> <%= csrf_meta_tags %> diff --git a/app/views/email_subscriptions/invalid_token.html.erb b/app/views/email_subscriptions/invalid_token.html.erb index 734674c36..8b06443d3 100644 --- a/app/views/email_subscriptions/invalid_token.html.erb +++ b/app/views/email_subscriptions/invalid_token.html.erb @@ -6,7 +6,7 @@
Please - sign-in + sign-in to manage your email preferences.
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index 44e8734e2..eee0c2acc 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -18,10 +18,10 @@
<% if @unsubscribe %> <%= link_to "Unsubscribe", email_subscriptions_unsubscribe_url(ut: @unsubscribe), style: "color:#7d7d7d" %> | - Adjust your email settings + Adjust your email settings <% else %> Don't want to get emails like this? Adjust your email settings at - dev.to/settings/notifications + <%= app_url(user_settings_path(:notifications)) %> <% end %>
diff --git a/app/views/mailers/digest_mailer/digest_email.html.erb b/app/views/mailers/digest_mailer/digest_email.html.erb index b7838bea0..8b4a2932b 100644 --- a/app/views/mailers/digest_mailer/digest_email.html.erb +++ b/app/views/mailers/digest_mailer/digest_email.html.erb @@ -5,7 +5,7 @@