
    i                     R    d dl Z d dlZd dlmZ  e j        e          ZdZdefdZ	dS )    N)settingsz
A guest requested to cancel their reservation through the chatbot.

Confirmation Number: {confirmation_number}

Please review this reservation and contact the guest if necessary.

This request was forwarded automatically by the chatbot.
confirmation_numberc                   K   	 t           j        }t           j        }d| d}d|  }t           j        t           j        g|t
                              |           d}t          j                    4 d {V }|	                    |d|f|           d {V }d d d           d {V  n# 1 d {V swxY w Y   |j
        dv rd	S d
S # t          $ r(}t                              d|            Y d }~d
S d }~ww xY w)Nzhttps://api.mailgun.net/v3/z	/messagesz#Reservation Cancellation Request - )r   )fromtosubjecttextapi)authdata)      TFzError sending email: )r   MAILGUN_SANDBOX_DOMAINMAILGUN_SANDBOX_SENDING_API_KEY
FROM_EMAILFRONTDESK_EMAILmessageformathttpxAsyncClientpoststatus_code	Exceptionlogerror)	r   domainapi_keyurlr   r   clientresponsees	            </var/www/html/ls-ibe-bot-apis/app/agents/tools/send_email.py
send_emailr#      s     0:=F===M8KMM '+,NN7JNKK	
 
 $&& 	 	 	 	 	 	 	&#[[W% )        H	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 :--4u   		-!--...uuuuus<   A1C 5!B(C (
B22C 5B26C 
C8C33C8)
loggingr   app.configsr   	getLogger__name__r   r   strr#        r"   <module>r+      sg                 g!!#      r*   