Merge pull request #2523 from techAPJ/patch-3

FIX: include topic title and domain name in topic invite mail
This commit is contained in:
Jeff Atwood 2014-07-09 21:38:17 -07:00
commit 0d9aacec24
3 changed files with 10 additions and 1 deletions

View File

@ -24,6 +24,7 @@ class InviteMailer < ActionMailer::Base
build_email(invite.email, build_email(invite.email,
template: 'invite_mailer', template: 'invite_mailer',
invitee_name: invitee_name, invitee_name: invitee_name,
site_domain_name: Discourse.current_hostname,
invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}", invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}",
topic_title: first_topic.try(:title), topic_title: first_topic.try(:title),
topic_excerpt: topic_excerpt, topic_excerpt: topic_excerpt,

View File

@ -1048,7 +1048,7 @@ en:
blocked: "is blocked." blocked: "is blocked."
invite_mailer: invite_mailer:
subject_template: "%{invitee_name} invited you to a discussion at %{site_name}" subject_template: "%{invitee_name} invited you to '%{topic_title}' on %{site_domain_name}"
text_body_template: | text_body_template: |
%{invitee_name} invited you to a discussion %{invitee_name} invited you to a discussion

View File

@ -42,6 +42,14 @@ describe InviteMailer do
expect(invite_mail.subject).to be_present expect(invite_mail.subject).to be_present
end end
it 'renders topic title in subject' do
expect(invite_mail.subject).to match(topic.title)
end
it 'renders site domain name in subject' do
expect(invite_mail.subject).to match(Discourse.current_hostname)
end
it 'renders the body' do it 'renders the body' do
expect(invite_mail.body).to be_present expect(invite_mail.body).to be_present
end end