feat: Support cc and bcc in email replies (#3098)
Co-authored-by: Tejaswini <tejaswini@chatwoot.com> Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
committed by
GitHub
parent
0e0632be22
commit
68e697c379
@@ -19,7 +19,9 @@ class ConversationReplyMailer < ApplicationMailer
|
||||
reply_to: reply_email,
|
||||
subject: mail_subject,
|
||||
message_id: custom_message_id,
|
||||
in_reply_to: in_reply_to_email
|
||||
in_reply_to: in_reply_to_email,
|
||||
cc: cc_bcc_emails[0],
|
||||
bcc: cc_bcc_emails[1]
|
||||
})
|
||||
end
|
||||
|
||||
@@ -39,7 +41,9 @@ class ConversationReplyMailer < ApplicationMailer
|
||||
reply_to: reply_email,
|
||||
subject: mail_subject,
|
||||
message_id: custom_message_id,
|
||||
in_reply_to: in_reply_to_email
|
||||
in_reply_to: in_reply_to_email,
|
||||
cc: cc_bcc_emails[0],
|
||||
bcc: cc_bcc_emails[1]
|
||||
})
|
||||
end
|
||||
|
||||
@@ -142,6 +146,15 @@ class ConversationReplyMailer < ApplicationMailer
|
||||
nil
|
||||
end
|
||||
|
||||
def cc_bcc_emails
|
||||
content_attributes = @conversation.messages.outgoing.last&.content_attributes
|
||||
|
||||
return [] unless content_attributes
|
||||
return [] unless content_attributes[:cc_emails] || content_attributes[:bcc_emails]
|
||||
|
||||
[content_attributes[:cc_emails], content_attributes[:bcc_emails]]
|
||||
end
|
||||
|
||||
def inbound_email_enabled?
|
||||
@inbound_email_enabled ||= @account.feature_enabled?('inbound_emails') && @account.inbound_email_domain
|
||||
.present? && @account.support_email.present?
|
||||
|
||||
Reference in New Issue
Block a user