a
    gh                     @   sB   d dl m Z  d dlmZ d dlmZ d dlmZ G dd dZdS )    )app)Message)Mail)Configc                   @   s   e Zd ZedddZdS )MailServiceNFc              
   C   s   z<t t}t| tj|gd}|r(||_n||_|| W dS  ty~ } z*t	|j
 t	dt|  W Y d }~dS d }~0 0 d S )N)sender
recipientsTzFailed to send email: F)r   r   r   r   MAIL_DEFAULT_SENDERhtmlbodysend	Exceptionprintargsstr)subject	recipientmessage
attachmentr
   Zmailmsge r   /app/app/services/mail.py
send_email	   s     

zMailService.send_email)NF)__name__
__module____qualname__staticmethodr   r   r   r   r   r      s   r   N)r   Z
flask_mailr   r   app.config.settingsr   r   r   r   r   r   <module>   s   