geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
84 stars 71 forks source link

Streamline email functionality #417

Open justb4 opened 2 years ago

justb4 commented 2 years ago

Is your feature request related to a problem? Please describe. Email is sent in two places: in notifications.py and in util.py (send_email function). Via #416 some fixes were made in notifications.py to cope with various email configurations TLS, no Auth etc, for both Docker and regular installs. This is for Resource notification only. All other email (lost password, status summary, ..) is still sent with util.py-send_email.

Describe the solution you'd like Provide a single send_email() function for all email-sending cases. Best is to take util.py-send_email and extend with the implementation in notifications.py. Make the function robust for config errors. May still be lean/silently fail, on login() failure as that is optional and may break existing installs.

Describe alternatives you've considered We could discard SMTPLib and use a higher level email lib. But that also introduces an additional dependency, plus may break existing installations.

Additional context N.A.