Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,9 @@ def pre_query(sender, recipient, recipient_name, context, input, model_id):
|
|
67 |
|
68 |
return
|
69 |
|
70 |
-
def set_email_link(email, recipient_address,
|
71 |
-
|
|
|
72 |
|
73 |
demo = gr.Blocks()
|
74 |
|
@@ -96,13 +97,12 @@ with demo:
|
|
96 |
|
97 |
with gr.Row():
|
98 |
recipient_address = gr.Textbox(label="To", placeholder ="recipient's address")
|
99 |
-
sender_address = gr.Textbox(label="From", placeholder ="your email address")
|
100 |
email_link = gr.Textbox(label="From", placeholder ="click after email")
|
101 |
send_email = gr.Button("Send email!")
|
102 |
|
103 |
input_list = [sender, recipient, recipient_name, subject, dates, email, model_id]
|
104 |
|
105 |
submit_button.click(pre_query, inputs = input_list, outputs=text_output)
|
106 |
-
send_email.click(set_email_link, inputs = [text_output, recipient_address,
|
107 |
|
108 |
demo.launch(debug=True)
|
|
|
67 |
|
68 |
return
|
69 |
|
70 |
+
def set_email_link(email, recipient_address, subject):
|
71 |
+
link = "mailto:" + recipient_address + "?subject=" + subject.replace(' ', '%20') + "&body=" + email.replace(' ', '%20')
|
72 |
+
return link
|
73 |
|
74 |
demo = gr.Blocks()
|
75 |
|
|
|
97 |
|
98 |
with gr.Row():
|
99 |
recipient_address = gr.Textbox(label="To", placeholder ="recipient's address")
|
|
|
100 |
email_link = gr.Textbox(label="From", placeholder ="click after email")
|
101 |
send_email = gr.Button("Send email!")
|
102 |
|
103 |
input_list = [sender, recipient, recipient_name, subject, dates, email, model_id]
|
104 |
|
105 |
submit_button.click(pre_query, inputs = input_list, outputs=text_output)
|
106 |
+
send_email.click(set_email_link, inputs = [text_output, recipient_address, subject], outputs = email_link)
|
107 |
|
108 |
demo.launch(debug=True)
|