From 8ce6ddb87f29a25d3ecab49754c6cd3c7027bf40 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 5 Oct 2020 23:09:14 +0530 Subject: [PATCH 1/6] Send confirmation email after successful submission of proposal --- conference/cfp.py | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/conference/cfp.py b/conference/cfp.py index fd1d48a66..ce8818dca 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -4,6 +4,7 @@ from django.contrib import messages from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required +from django.contrib.sites.shortcuts import get_current_site from django.core.mail import send_mail from django.urls import reverse_lazy from django.db import transaction @@ -120,9 +121,31 @@ def submit_proposal_step3_thanks(request, talk_uuid): Step3 - thanks for proposal """ talk = get_object_or_404(Talk, uuid=talk_uuid) - return TemplateResponse(request, "conference/cfp/step3_thanks.html", { - "talk": talk, - }) + speakers = list(talk.get_all_speakers()) + speaker_emails = [speaker.user.email for speaker in speakers] + speaker_names = ",".join( + [f"{speaker.user.first_name} {speaker.user.last_name}" for speaker in speakers] + ) + current_site = get_current_site(request) + cfp_path = reverse_lazy("cfp:preview", args=[talk.slug]) + proposal_url = f"https://{current_site}{cfp_path}" + content = f""" + Hi {speaker_names}! + We have received your submission "{talk.title}". + We will notify you once we have had time to consider all submissions, + but until then you can see and edit your submission at {proposal_url} + + Please do not hesitate to contact us at at helpdesk@europython.eu if you have any questions! + """ + send_mail( + subject=f"Your submission to Europython: {talk.title}", + message=content, + from_email=settings.DEFAULT_FROM_EMAIL, + recipient_list=speaker_emails, + ) + return TemplateResponse( + request, "conference/cfp/step3_thanks.html", {"talk": talk,} + ) @login_required From 0e415b8155a031f4d06c1f0e494e504bffbf3a4d Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 5 Oct 2020 23:16:31 +0530 Subject: [PATCH 2/6] Replace hardcoded conference name --- conference/cfp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conference/cfp.py b/conference/cfp.py index ce8818dca..792cd2cdb 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -138,7 +138,7 @@ def submit_proposal_step3_thanks(request, talk_uuid): Please do not hesitate to contact us at at helpdesk@europython.eu if you have any questions! """ send_mail( - subject=f"Your submission to Europython: {talk.title}", + subject=f"Your submission to {settings.CONFERENCE_NAME}: {talk.title}", message=content, from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=speaker_emails, From 3066d1de5e9935d9c4910c4a8a7c755106131e16 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Fri, 7 May 2021 17:13:19 +0530 Subject: [PATCH 3/6] Add bcc --- conference/cfp.py | 3 ++- pycon/settings.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conference/cfp.py b/conference/cfp.py index 52f0d1048..26d5f5fab 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -82,6 +82,7 @@ def send_talk_details_to_backup_email(talk: Talk): message=content, from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=SEND_CFP_BACKUP_TO, + bcc=settings.CFP_SUBMISSION_BCC_ADDRESS ) @@ -135,7 +136,7 @@ def submit_proposal_step3_thanks(request, talk_uuid): We will notify you once we have had time to consider all submissions, but until then you can see and edit your submission at {proposal_url} - Please do not hesitate to contact us at at helpdesk@europython.eu if you have any questions! + Please do not hesitate to contact us at at program@europython.eu if you have any questions! """ send_mail( subject=f"Your submission to {settings.CONFERENCE_NAME}: {talk.title}", diff --git a/pycon/settings.py b/pycon/settings.py index e940b0b15..fd4aaf087 100644 --- a/pycon/settings.py +++ b/pycon/settings.py @@ -81,6 +81,9 @@ def _(x): # Email sender address used per default for emails to e.g. attendees DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', default='info@europython.eu') +# BCC these emails on cfp submissions +CFP_SUBMISSION_BCC_ADDRESS = config('CFP_SUBMISSION_BCC_ADDRESS', default=['program@europython.eu']) + # Timezone and languages # ----------------------- # If you set this to False, Django will make some optimizations so as not From 9cc74773418d77b89ecf92a0d4c9138d5cfabe96 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Fri, 7 May 2021 17:14:31 +0530 Subject: [PATCH 4/6] move bcc to cfp response --- conference/cfp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conference/cfp.py b/conference/cfp.py index 26d5f5fab..5541fc56d 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -82,7 +82,6 @@ def send_talk_details_to_backup_email(talk: Talk): message=content, from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=SEND_CFP_BACKUP_TO, - bcc=settings.CFP_SUBMISSION_BCC_ADDRESS ) @@ -143,6 +142,7 @@ def submit_proposal_step3_thanks(request, talk_uuid): message=content, from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=speaker_emails, + bcc=settings.CFP_SUBMISSION_BCC_ADDRESS ) return TemplateResponse( request, "conference/cfp/step3_thanks.html", {"talk": talk,} From a4edb8f15e0b5b7550475f1a5a21d85bd75579e5 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Fri, 21 May 2021 12:18:31 +0530 Subject: [PATCH 5/6] Remove bcc param --- conference/cfp.py | 3 +-- pycon/settings.py | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/conference/cfp.py b/conference/cfp.py index 5541fc56d..e1937a85c 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -67,7 +67,7 @@ def send_talk_details_to_backup_email(talk: Talk): """ SEND_CFP_BACKUP_TO = ['web-wg@europython.eu'] - content = f""" + content = f"""\ title: {talk.title} author: {talk.created_by.id} type_display: {talk.get_type_display()} @@ -142,7 +142,6 @@ def submit_proposal_step3_thanks(request, talk_uuid): message=content, from_email=settings.DEFAULT_FROM_EMAIL, recipient_list=speaker_emails, - bcc=settings.CFP_SUBMISSION_BCC_ADDRESS ) return TemplateResponse( request, "conference/cfp/step3_thanks.html", {"talk": talk,} diff --git a/pycon/settings.py b/pycon/settings.py index fd4aaf087..e940b0b15 100644 --- a/pycon/settings.py +++ b/pycon/settings.py @@ -81,9 +81,6 @@ def _(x): # Email sender address used per default for emails to e.g. attendees DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', default='info@europython.eu') -# BCC these emails on cfp submissions -CFP_SUBMISSION_BCC_ADDRESS = config('CFP_SUBMISSION_BCC_ADDRESS', default=['program@europython.eu']) - # Timezone and languages # ----------------------- # If you set this to False, Django will make some optimizations so as not From e01725e4dfc802257f5fb003b9b80a396efd373f Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Fri, 21 May 2021 12:24:51 +0530 Subject: [PATCH 6/6] add " --- conference/cfp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conference/cfp.py b/conference/cfp.py index e1937a85c..7061d839f 100644 --- a/conference/cfp.py +++ b/conference/cfp.py @@ -67,7 +67,7 @@ def send_talk_details_to_backup_email(talk: Talk): """ SEND_CFP_BACKUP_TO = ['web-wg@europython.eu'] - content = f"""\ + content = f""" title: {talk.title} author: {talk.created_by.id} type_display: {talk.get_type_display()} @@ -129,7 +129,7 @@ def submit_proposal_step3_thanks(request, talk_uuid): current_site = get_current_site(request) cfp_path = reverse_lazy("cfp:preview", args=[talk.slug]) proposal_url = f"https://{current_site}{cfp_path}" - content = f""" + content = f"""\ Hi {speaker_names}! We have received your submission "{talk.title}". We will notify you once we have had time to consider all submissions,