Feature/comp 257 send email on signup
2 unresolved threads
2 unresolved threads
Merge request reports
Activity
assigned to @mohammad.torkashvand
- compendium_v2/email/__init__.py 0 → 100644
17 server.sendmail(from_addr=sender_email, to_addrs=recipients, msg=message) 18 logger.debug('Successfully sent email') 19 except Exception: 20 logger.exception('Unable to send email:') 21 22 23 def send_mail( 24 contents: str, 25 subject: str = 'New user signed up for Compendium', 26 recipients: Union[str, Sequence[str]] = '' 27 ): 28 if not current_app.config['MAIL_ENABLE']: 29 logger.warning('No mail configuration, cannot send email.') 30 return 31 32 if not isinstance(contents, str): changed this line in version 3 of the diff
- compendium_v2/email/__init__.py 0 → 100644
5 from sqlalchemy import select 6 from flask import current_app 7 from compendium_v2 import db 8 from compendium_v2.db.auth_model import User, ROLES 9 10 logger = logging.getLogger(__name__) 11 12 13 def _send_mail(smtp_server, port, sender_email, recipients, message): 14 15 try: 16 with smtplib.SMTP(smtp_server, port) as server: 17 server.sendmail(from_addr=sender_email, to_addrs=recipients, msg=message) 18 logger.debug('Successfully sent email') 19 except Exception: 20 logger.exception('Unable to send email:') added 2 commits
mentioned in commit a41048aa
Please register or sign in to reply