Skip to content

Commit 9d3385f

Browse files
committed
adds a conditional to include conversation title in subject line if present
1 parent 23aeae3 commit 9d3385f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/mailers/better_together/conversation_mailer.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def new_message_notification # rubocop:todo Metrics/MethodLength, Metrics/AbcSiz
1111
@recipient = params[:recipient]
1212
@sender = @message.sender
1313

14+
subject = t('better_together.conversation_mailer.new_message_notification.subject')
15+
if @conversation.title.present?
16+
subject = t('better_together.conversation_mailer.new_message_notification.subject_with_title',
17+
conversation: @conversation.title)
18+
end
19+
1420
# Override time zone and locale if necessary
1521
self.locale = @recipient.locale
1622
self.time_zone = @recipient.time_zone
@@ -19,9 +25,7 @@ def new_message_notification # rubocop:todo Metrics/MethodLength, Metrics/AbcSiz
1925
from: t('better_together.conversation_mailer.new_message_notification.from_address',
2026
sender_name: @sender.name,
2127
from_address: default_params[:from]),
22-
subject: t('better_together.conversation_mailer.new_message_notification.subject',
23-
platform: @platform.name,
24-
conversation: @conversation.title))
28+
subject:)
2529
end
2630
# rubocop:enable Metrics/AbcSize
2731
end

0 commit comments

Comments
 (0)