From ff027350556feba03d67c7cacdef1cfab8fe63fe Mon Sep 17 00:00:00 2001 From: Colin Goutte Date: Wed, 20 Oct 2021 12:28:58 +0200 Subject: [PATCH] Customize emails --- papi/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/papi/main.py b/papi/main.py index 07036c0..dd04deb 100644 --- a/papi/main.py +++ b/papi/main.py @@ -278,9 +278,15 @@ def post_sonde_data( html = res.body.decode("utf-8") from papi.mail_sendermodel import sendmail - cond = False - if cond: - sendmail(html) + conf = PROBES[idsonde] + sumup = utils.sample2statuscount(present) + subject = " ; ".join(sumup) + sendmail( + htmlpart=html, + emails=conf["emails"], + subject=subject, + ) + return { "count": len(mesures_) if "date" in mesures_[0].content.keys()