a
    AWe                     @   s6   d dl mZ d dlmZ d dlmZ G dd dZdS )    )current_app)Message)Configc                   @   s   e Zd ZedddZdS )MailServiceNFc              
   C   s|   z>t jd }t| tj|gd}|r*||_n||_|| W dS  tyv } z t	dt
|  W Y d }~dS d }~0 0 d S )Nmail)sender
recipientsTzFailed to send email: F)r   
extensionsr   r   MAIL_DEFAULT_SENDERhtmlbodysend	Exceptionprintstr)subject	recipientmessage
attachmentr   r   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)flaskr   
flask_mailr   app.config.settingsr   r   r   r   r   r   <module>   s   