feat: (IMAP) Always BCC (#28961)

This commit is contained in:
0xD0M1M0 2025-02-20 12:47:17 +01:00 committed by GitHub
parent c66c41608e
commit 7b96f19917
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 2 deletions

View file

@ -73,6 +73,7 @@
"smtp_port",
"column_break_38",
"no_smtp_authentication",
"always_bcc",
"signature_section",
"add_signature",
"signature",
@ -699,12 +700,19 @@
"fieldname": "sent_folder_name",
"fieldtype": "Data",
"label": "Sent Folder Name"
},
{
"description": "Use this, for example, if all sent emails should also be send to an archive.",
"fieldname": "always_bcc",
"fieldtype": "Data",
"label": "Always BCC Address",
"options": "Email"
}
],
"icon": "fa fa-inbox",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-12-04 23:30:37.622353",
"modified": "2024-12-30 11:25:58.427173",
"modified_by": "Administrator",
"module": "Email",
"name": "Email Account",

View file

@ -60,6 +60,7 @@ class EmailAccount(Document):
from frappe.types import DF
add_signature: DF.Check
always_bcc: DF.Data | None
always_use_account_email_id_as_sender: DF.Check
always_use_account_name_as_sender_name: DF.Check
api_key: DF.Data | None

View file

@ -690,6 +690,9 @@ class QueueBuilder:
return attachments
def prepare_email_content(self):
email_account = self.get_outgoing_email_account()
if isinstance(self._bcc, list) and email_account.always_bcc is not None:
self._bcc.append(str(email_account.always_bcc))
mail = get_email(
recipients=self.final_recipients(),
sender=self.sender,
@ -700,7 +703,7 @@ class QueueBuilder:
reply_to=self.reply_to,
cc=self.final_cc(),
bcc=self.bcc,
email_account=self.get_outgoing_email_account(),
email_account=email_account,
expose_recipients=self.expose_recipients,
inline_images=self.inline_images,
header=self.header,