diff --git a/app/mailers/conversation_reply_mailer.rb b/app/mailers/conversation_reply_mailer.rb index 9fe65d231..ce8a91670 100644 --- a/app/mailers/conversation_reply_mailer.rb +++ b/app/mailers/conversation_reply_mailer.rb @@ -20,7 +20,8 @@ class ConversationReplyMailer < ApplicationMailer private - def mail_subject(last_message, trim_length = 30) - "[##{@conversation.display_id}] #{last_message.content.truncate(trim_length)}" + def mail_subject(last_message, trim_length = 50) + subject_line = last_message&.content&.truncate(trim_length) || 'New messages on this conversation' + "[##{@conversation.display_id}] #{subject_line}" end end diff --git a/app/views/mailers/conversation_reply_mailer/reply_with_summary.html.erb b/app/views/mailers/conversation_reply_mailer/reply_with_summary.html.erb index ecc93eeba..51e486380 100644 --- a/app/views/mailers/conversation_reply_mailer/reply_with_summary.html.erb +++ b/app/views/mailers/conversation_reply_mailer/reply_with_summary.html.erb @@ -8,7 +8,13 @@ <%= message.incoming? ? 'You' : message.user.name %> - : <%= message.content %> + : + <% if message.attachment %> + attachment [click here to view] + <% else %> + <%= message.content %> + <% end %> + <% end %>