Skip to content

Commit 16075d2

Browse files
Merge pull request #6 from NatLibFi/ekir-205-sender-header
Add sender header and env variable
2 parents 20cb522 + f3164b1 commit 16075d2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DEFAULT_RECEIVER=${DEFAULT_RECEIVER}
1010
# A copy of the emails is always sent to this address
1111
ALWAYS_RECIPIENT=${ALWAYS_RECIPIENT}
1212
MAIL_SENDER=${MAIL_SENDER}
13+
MAIL_FROM=${MAIL_FROM}
1314
BACKUP_FILE="feedback.backup"
1415

1516
# Location of the csv file that contains emails and municipality names.

app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def send_email(subject, body, reply_to, recipients):
177177

178178
message.set_content(body)
179179
message["To"] = ",".join(recipients)
180-
message["From"] = app.config["MAIL_SENDER"]
180+
message["From"] = app.config["MAIL_FROM"]
181+
message["Sender"] = app.config["MAIL_SENDER"]
181182
message["Subject"] = subject
182183
# Setting the Reply-To header here so that replying to emails is more convenient
183184
if reply_to:

0 commit comments

Comments
 (0)