Skip to content

Commit 23b9089

Browse files
committed
updates from line on notification mailer
1 parent 5e47ec4 commit 23b9089

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

app/mailers/better_together/conversation_mailer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def new_message_notification # rubocop:todo Metrics/MethodLength, Metrics/AbcSiz
1616
self.time_zone = @recipient.time_zone
1717

1818
mail(to: @recipient.email,
19-
from: "#{@sender.name} via #{@platform.name}",
19+
from: t('better_together.conversation_mailer.new_message_notification.from_address',
20+
sender_name: @sender.name,
21+
from_address: default_params[:from]),
2022
subject: t('better_together.conversation_mailer.new_message_notification.subject',
2123
platform: @platform.name,
2224
conversation: @conversation.title))

app/views/better_together/conversation_mailer/new_message_notification.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
<p><%= link_to conversation_url(@conversation), conversation_url(@conversation) %></p>
1616

17-
<p><%= t('.signature', platform: @platform.name) %></p>
17+
<p><%= t('.signature_html', platform: @platform.name) %></p>

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ en:
627627
add: Add Contact
628628
conversation_mailer:
629629
new_message_notification:
630+
from_address: '%{sender_name} via %{from_address}'
630631
greeting: Hello %{recipient_name},
631632
message_intro: 'You have a new message in the conversation "%{conversation}":'
632633
signature: Signature

spec/mailers/better_together/conversation_mailer_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ module BetterTogether
1717
end
1818

1919
it 'renders the headers' do
20-
expect(mail.subject).to eq("[#{host_platform.name}] New message in conversation \"#{conversation.title}\"")
21-
expect(mail.to).to eq([recipient.email])
22-
expect(mail.from).to eq(['[email protected]'])
20+
expect(mail.subject).to eq("New message in conversation \"#{conversation.title}\"")
21+
expect(mail.to).to include(recipient.email)
22+
expect(mail.from).to include('[email protected]')
2323
end
2424

2525
it 'renders the body' do

spec/mailers/previews/better_together/conversation_mailer_preview.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ConversationMailerPreview < ActionMailer::Preview
88

99
# Preview this email at http://localhost:3000/rails/mailers/better_together/conversation_mailer/new_message_notification
1010
def new_message_notification
11-
host_platform || create(:platform)
11+
host_platform || create(:platform, :host)
1212
sender = create(:user, :confirmed)
1313
recipient = create(:user, :confirmed)
1414
conversation = create(:conversation, creator: sender.person)

0 commit comments

Comments
 (0)