Skip to content

Commit

Permalink
Add sender header and env variable
Browse files Browse the repository at this point in the history
Add sender to the Sender header and MAIL_SENDER environment variable.

Refs EKIR-205
  • Loading branch information
natlibfi-max-grasbeck committed Jun 3, 2024
1 parent 4f5b46c commit f3164b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DEFAULT_RECEIVER=${DEFAULT_RECEIVER}
# A copy of the emails is always sent to this address
ALWAYS_RECIPIENT=${ALWAYS_RECIPIENT}
MAIL_SENDER=${MAIL_SENDER}
MAIL_FROM=${MAIL_FROM}
BACKUP_FILE="feedback.backup"

# Location of the csv file that contains emails and municipality names.
Expand Down
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def send_email(subject, body, recipients, reply_to):

message.set_content(body)
message["To"] = ",".join(recipients)
message["From"] = app.config["MAIL_SENDER"]
message["From"] = app.config["MAIL_FROM"]
message["Sender"] = app.config["MAIL_SENDER"]
message["Subject"] = subject

context = ssl.SSLContext(ssl.PROTOCOL_TLS)
Expand Down

0 comments on commit f3164b1

Please sign in to comment.