mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 07:33:37 +08:00
Merge pull request #2523 from techAPJ/patch-3
FIX: include topic title and domain name in topic invite mail
This commit is contained in:
commit
0d9aacec24
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user