Changeset - c287dac43303
[Not reviewed]
0 2 0
Ben Sturmfels (bsturmfels) - 3 months ago 2024-01-31 01:28:45
ben@sturm.com.au
usethesource: Make email addresses configurable
2 files changed with 21 insertions and 6 deletions:
0 comments (0 inline, 0 general)
conservancy/settings.py
Show inline comments
...
 
@@ -151 +151,6 @@ MIDDLEWARE = [
 
]
 

	
 
USETHESOURCE = {
 
    'SENDER': 'compliance@sfconservancy.org',
 
    'LIST_RECIPIENT': 'nutbush@lists.sfconservancy.org',
 
}
conservancy/usethesource/emails.py
Show inline comments
 
from django.conf import settings
 
from django.core.mail import EmailMessage
...
 
@@ -3,4 +4,4 @@ from django.shortcuts import reverse
 

	
 
SENDER = 'compliance@sfconservancy.org'
 
LIST_RECIPIENT = 'nutbush@lists.sfconservancy.org'
 
SENDER = settings.USETHESOURCE['SENDER']
 
LIST_RECIPIENT = settings.USETHESOURCE['LIST_RECIPIENT']
 

	
...
 
@@ -23,3 +24,3 @@ Released: {candidate.release_date}
 

	
 
To download this candidate's source and binary image, visit:
 
To view this candidate and download the source and binary image, visit:
 
https://sfconservancy.org{reverse('usethesource:candidate', kwargs={'slug': candidate.slug})}
...
 
@@ -28,3 +29,3 @@ https://sfconservancy.org{reverse('usethesource:candidate', kwargs={'slug': cand
 
{signature}
 
'''
 
(Via http//sfconservancy.org{reverse('usethesource:landing')})'''
 
    headers = {'Message-ID': candidate.email_message_id}
...
 
@@ -35,3 +36,4 @@ def make_comment_email(comment):
 
    """Email when a comment is added to a candidate."""
 
    subject = f'Re: {comment.candidate.name}'
 
    candidate = comment.candidate
 
    subject = f'Re: {candidate.name}'
 
    signature = comment.user.get_full_name() or comment.user.username
...
 
@@ -39,3 +41,11 @@ def make_comment_email(comment):
 
    to = [LIST_RECIPIENT]
 
    body = f'{comment.message}\n\n--\n{signature}'
 
    body = f'''\
 
{comment.message}
 

	
 
To view this candidate and download the source and binary image, visit:
 
https://sfconservancy.org{reverse('usethesource:candidate', kwargs={'slug': candidate.slug})}
 

	
 
--
 
{signature}
 
(Via http//sfconservancy.org{reverse('usethesource:landing')})'''
 
    headers = {'Message-ID': comment.email_message_id}
0 comments (0 inline, 0 general)