mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 00:48:32 +01:00
take into account NOT_SEND_EMAIL param
This commit is contained in:
parent
74fe984ae1
commit
9dd4a4afb7
1 changed files with 17 additions and 1 deletions
|
@ -5,7 +5,13 @@ from smtplib import SMTP
|
|||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
from app.config import SUPPORT_EMAIL, ROOT_DIR, POSTFIX_SERVER, ADMIN_EMAIL
|
||||
from app.config import (
|
||||
SUPPORT_EMAIL,
|
||||
ROOT_DIR,
|
||||
POSTFIX_SERVER,
|
||||
ADMIN_EMAIL,
|
||||
NOT_SEND_EMAIL,
|
||||
)
|
||||
from app.log import LOG
|
||||
|
||||
|
||||
|
@ -93,6 +99,16 @@ def send_test_email_alias(email, name):
|
|||
|
||||
|
||||
def send_by_postfix(to_email, subject, plaintext, html):
|
||||
if NOT_SEND_EMAIL:
|
||||
LOG.d(
|
||||
"send email with subject %s to %s, plaintext: %s, html:%s",
|
||||
subject,
|
||||
to_email,
|
||||
plaintext,
|
||||
html,
|
||||
)
|
||||
return
|
||||
|
||||
# host IP, setup via Docker network
|
||||
smtp = SMTP(POSTFIX_SERVER, 25)
|
||||
msg = EmailMessage()
|
||||
|
|
Loading…
Reference in a new issue