This repository was archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Send confirmation email after successful submission of proposal #1331
Open
Sangarshanan
wants to merge
9
commits into
EuroPython:ep2021
Choose a base branch
from
Sangarshanan:cfp-confirmation
base: ep2021
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8ce6ddb
Send confirmation email after successful submission of proposal
Sangarshanan 0e415b8
Replace hardcoded conference name
Sangarshanan 7f4c78f
Merge branch 'ep2021' into cfp-confirmation
Sangarshanan 3066d1d
Add bcc
Sangarshanan 9cc7477
move bcc to cfp response
Sangarshanan a4edb8f
Remove bcc param
Sangarshanan 1242f4e
Merge branch 'ep2021' into cfp-confirmation
Sangarshanan e01725e
add "
Sangarshanan a4b6a8a
Merge branch 'cfp-confirmation' of github.com:Sangarshanan/epcon into…
Sangarshanan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] if you have any questions! | ||
""" | ||
send_mail( | ||
subject=f"Your submission to {settings.CONFERENCE_NAME}: {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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.