From 7bbcbcc4981a74ab23f1d92bbdb97f648bf9989f Mon Sep 17 00:00:00 2001 From: Mike Stuffel <36776908+detvan@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:50:31 +0200 Subject: [PATCH 1/4] EMAIL_CC update helpers.py EMAIL_CC in fir_notifications doesnt work for me. When i added these lines it does. Since iam not Python Dev please review this code. Thank you --- fir_email/helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fir_email/helpers.py b/fir_email/helpers.py index 804f298d..0cceb268 100644 --- a/fir_email/helpers.py +++ b/fir_email/helpers.py @@ -25,6 +25,10 @@ def prepare_email_message(to, subject, body, behalf=None, cc=None, bcc=None, req if not isinstance(to, (tuple, list)): to = to.split(';') + if hasattr(settings, 'EMAIL_CC'): + cc = settings.EMAIL_CC + + email_message = EmailMultiAlternatives( subject=subject, body=body, From 27b28b47f0f52ca70a0f0ce1c87666d101a6d099 Mon Sep 17 00:00:00 2001 From: Mike Stuffel <36776908+detvan@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:57:32 +0200 Subject: [PATCH 2/4] delete empty line formatting --- fir_email/helpers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/fir_email/helpers.py b/fir_email/helpers.py index 0cceb268..3bd5b449 100644 --- a/fir_email/helpers.py +++ b/fir_email/helpers.py @@ -28,7 +28,6 @@ def prepare_email_message(to, subject, body, behalf=None, cc=None, bcc=None, req if hasattr(settings, 'EMAIL_CC'): cc = settings.EMAIL_CC - email_message = EmailMultiAlternatives( subject=subject, body=body, From 0c401e62208be0c19e82460adceb814e1c2a7bd6 Mon Sep 17 00:00:00 2001 From: Mike Stuffel <36776908+detvan@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:34:40 +0200 Subject: [PATCH 3/4] added EMAIL_CC and EMAIL_BCC options added EMAIL_CC and EMAIL_BCC options to fir_notifications plugin --- fir_notifications/methods/email.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fir_notifications/methods/email.py b/fir_notifications/methods/email.py index 49f948cb..75cb1d5a 100644 --- a/fir_notifications/methods/email.py +++ b/fir_notifications/methods/email.py @@ -28,7 +28,8 @@ def send(self, event, users, instance, paths): continue params = self.prepare(template, instance) email_message = prepare_email_message([user.email, ], params['subject'], params['description'], - request=request) + request=request, cc=getattr(settings, 'EMAIL_CC'), + bcc=getattr(settings, 'EMAIL_BCC')) messages.append(email_message) if len(messages): connection = mail.get_connection() From 77f9ea6763adeaec6f93a0335c9549d2aca94e83 Mon Sep 17 00:00:00 2001 From: Mike Stuffel <36776908+detvan@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:36:51 +0200 Subject: [PATCH 4/4] roll back EMAIL_CC rool back EMAIL_CC because Alert, Takedown feature is impacted too. --- fir_email/helpers.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/fir_email/helpers.py b/fir_email/helpers.py index 3bd5b449..804f298d 100644 --- a/fir_email/helpers.py +++ b/fir_email/helpers.py @@ -25,9 +25,6 @@ def prepare_email_message(to, subject, body, behalf=None, cc=None, bcc=None, req if not isinstance(to, (tuple, list)): to = to.split(';') - if hasattr(settings, 'EMAIL_CC'): - cc = settings.EMAIL_CC - email_message = EmailMultiAlternatives( subject=subject, body=body,