FIX: correct use of invitee vs inviter in email templates

This commit is contained in:
Arpit Jalan 2017-12-04 13:59:24 +05:30
parent d041377ccf
commit 0e0794dff9
2 changed files with 12 additions and 12 deletions

View File

@ -13,9 +13,9 @@ class InviteMailer < ActionMailer::Base
first_topic = invite.topics.order(:created_at).first
# get invitee name (based on site setting)
invitee_name = invite.invited_by.username
inviter_name = invite.invited_by.username
if SiteSetting.enable_names && invite.invited_by.name.present?
invitee_name = "#{invite.invited_by.name} (#{invite.invited_by.username})"
inviter_name = "#{invite.invited_by.name} (#{invite.invited_by.username})"
end
# If they were invited to a topic
@ -39,7 +39,7 @@ class InviteMailer < ActionMailer::Base
build_email(invite.email,
template: template,
invitee_name: invitee_name,
inviter_name: inviter_name,
site_domain_name: Discourse.current_hostname,
invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}",
topic_title: topic_title,
@ -55,7 +55,7 @@ class InviteMailer < ActionMailer::Base
build_email(invite.email,
template: template,
invitee_name: invitee_name,
inviter_name: inviter_name,
site_domain_name: Discourse.current_hostname,
invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}",
site_description: SiteSetting.site_description,

View File

@ -1798,9 +1798,9 @@ en:
invite_mailer:
title: "Invite Mailer"
subject_template: "%{invitee_name} invited you to '%{topic_title}' on %{site_domain_name}"
subject_template: "%{inviter_name} invited you to '%{topic_title}' on %{site_domain_name}"
text_body_template: |
%{invitee_name} invited you to a discussion
%{inviter_name} invited you to a discussion
> **%{topic_title}**
>
@ -1816,9 +1816,9 @@ en:
custom_invite_mailer:
title: "Custom Invite Mailer"
subject_template: "%{invitee_name} invited you to '%{topic_title}' on %{site_domain_name}"
subject_template: "%{inviter_name} invited you to '%{topic_title}' on %{site_domain_name}"
text_body_template: |
%{invitee_name} invited you to a discussion
%{inviter_name} invited you to a discussion
> **%{topic_title}**
>
@ -1838,9 +1838,9 @@ en:
invite_forum_mailer:
title: "Invite Forum Mailer"
subject_template: "%{invitee_name} invited you to join %{site_domain_name}"
subject_template: "%{inviter_name} invited you to join %{site_domain_name}"
text_body_template: |
%{invitee_name} invited you to join
%{inviter_name} invited you to join
> **%{site_title}**
>
@ -1852,9 +1852,9 @@ en:
custom_invite_forum_mailer:
title: "Custom Invite Forum Mailer"
subject_template: "%{invitee_name} invited you to join %{site_domain_name}"
subject_template: "%{inviter_name} invited you to join %{site_domain_name}"
text_body_template: |
%{invitee_name} invited you to join
%{inviter_name} invited you to join
> **%{site_title}**
>