FIX: include topic title and domain name in topic invite mail

This commit is contained in:
Arpit Jalan 2014-07-10 10:03:09 +05:30
parent c5d3db9148
commit 8395da5bd0
3 changed files with 10 additions and 1 deletions

View File

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

View File

@ -1048,7 +1048,7 @@ en:
blocked: "is blocked."
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: |
%{invitee_name} invited you to a discussion

View File

@ -42,6 +42,14 @@ describe InviteMailer do
expect(invite_mail.subject).to be_present
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
expect(invite_mail.body).to be_present
end