3
Ule                 @   st   d dl mZ d dlmZ d dlT d dlmZ d dlZd dlZd dl	m
Z
 d dlZd dlmZ d dlmZ d	d
 ZdS )    )reverse)request)*)settingsN)Web3)SendGridAPIClient)Mailc              C   sx   t ddddd} y6ttj}|j| }t|j t|j t|j W n, t	k
rr } zt|j
 W Y d d }~X nX d S )Nzcontact@selltix.frzcsurbier@idevotion.frz#Sending with Twilio SendGrid is Funz:<strong>and easy to do anywhere, even with Python</strong>)
from_emailZ	to_emailssubjectZhtml_content)r   r   r   SENDGRID_API_KEYsendprintstatus_codebodyheaders	Exceptionmessage)r   Zsgresponsee r   G/home/csurbier/selltix_backend/SellTix/tixsellbackend/scripts/divers.pyrun   s    



r   )django.urlsr   urllib3r   backoffice.modelsZtixsellr   stripejsonweb3r   osZsendgridr   Zsendgrid.helpers.mailr   r   r   r   r   r   <module>   s   