feat: add references header to reply emails (#11719)

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Shivam Mishra
2025-07-29 14:24:14 +04:00
committed by GitHub
parent 441cc065ae
commit 6475a6a593
10 changed files with 449 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ class ConversationReplyMailer < ApplicationMailer
attr_reader :large_attachments
include ConversationReplyMailerHelper
include ReferencesHeaderBuilder
default from: ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
layout :choose_layout
@@ -160,6 +161,7 @@ class ConversationReplyMailer < ApplicationMailer
end
def conversation_reply_email_id
# Find the last incoming message's message_id to reply to
content_attributes = @conversation.messages.incoming.last&.content_attributes
if content_attributes && content_attributes['email'] && content_attributes['email']['message_id']
@@ -169,6 +171,10 @@ class ConversationReplyMailer < ApplicationMailer
nil
end
def references_header
build_references_header(@conversation, in_reply_to_email)
end
def cc_bcc_emails
content_attributes = @conversation.messages.outgoing.last&.content_attributes