add dkim signature for export data email (#1083)
* add dkim signature for export data email * fix
This commit is contained in:
parent
715ce33b09
commit
39aeb81f9a
|
@ -14,7 +14,7 @@ import sqlalchemy
|
||||||
from app import config
|
from app import config
|
||||||
from app.db import Session
|
from app.db import Session
|
||||||
from app.email import headers
|
from app.email import headers
|
||||||
from app.email_utils import generate_verp_email, render
|
from app.email_utils import generate_verp_email, render, add_dkim_signature
|
||||||
from app.mail_sender import sl_sendmail
|
from app.mail_sender import sl_sendmail
|
||||||
from app.models import (
|
from app.models import (
|
||||||
Alias,
|
Alias,
|
||||||
|
@ -141,6 +141,10 @@ class ExportUserDataJob:
|
||||||
attachment.add_header("Content-Type", "application/zip")
|
attachment.add_header("Content-Type", "application/zip")
|
||||||
msg.attach(attachment)
|
msg.attach(attachment)
|
||||||
|
|
||||||
|
# add DKIM
|
||||||
|
email_domain = config.NOREPLY[config.NOREPLY.find("@") + 1 :]
|
||||||
|
add_dkim_signature(msg, email_domain)
|
||||||
|
|
||||||
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
transaction = TransactionalEmail.create(email=to_email, commit=True)
|
||||||
sl_sendmail(
|
sl_sendmail(
|
||||||
generate_verp_email(VerpType.transactional, transaction.id),
|
generate_verp_email(VerpType.transactional, transaction.id),
|
||||||
|
|
Loading…
Reference in a new issue