fix envoi mail etud change

This commit is contained in:
Emmanuel Viennet 2021-09-14 12:21:22 +02:00
parent 61db542608
commit 3496cc7beb

View File

@ -31,27 +31,21 @@
# Ancien module "scolars" # Ancien module "scolars"
import os import os
import time import time
from flask import url_for, g, request
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email.mime.base import MIMEBase
from operator import itemgetter from operator import itemgetter
from flask import url_for, g, request
from flask_mail import Message
from app import email
from app import log
import app.scodoc.sco_utils as scu import app.scodoc.sco_utils as scu
from app.scodoc.sco_utils import SCO_ENCODING
import app.scodoc.notesdb as ndb import app.scodoc.notesdb as ndb
from app.scodoc.sco_exceptions import ScoGenError, ScoValueError from app.scodoc.sco_exceptions import ScoGenError, ScoValueError
from app import log
from app.scodoc.TrivialFormulator import TrivialFormulator
from app.scodoc import safehtml from app.scodoc import safehtml
from app.scodoc import sco_preferences from app.scodoc import sco_preferences
from app.scodoc.scolog import logdb from app.scodoc.scolog import logdb
from flask_mail import Message from app.scodoc.TrivialFormulator import TrivialFormulator
from app import mail
MONTH_NAMES_ABBREV = [ MONTH_NAMES_ABBREV = [
"Jan ", "Jan ",
@ -456,7 +450,7 @@ def notify_etud_change(email_addr, etud, before, after, subject):
log("notify_etud_change: sending notification to %s" % email_addr) log("notify_etud_change: sending notification to %s" % email_addr)
log("notify_etud_change: subject: %s" % subject) log("notify_etud_change: subject: %s" % subject)
log(txt) log(txt)
mail.send_email( email.send_email(
subject, sco_preferences.get_preference("email_from_addr"), [email_addr], txt subject, sco_preferences.get_preference("email_from_addr"), [email_addr], txt
) )
return txt return txt