Update app.py
Browse files
app.py
CHANGED
@@ -69,9 +69,11 @@ def pre_query(sender, recipient, recipient_name, context, input, model_id):
|
|
69 |
|
70 |
def set_email_link(email, recipient_address, subject):
|
71 |
email = email.replace(' ', '%20')
|
72 |
-
link = "mailto:" + recipient_address + "?subject=" + subject.replace(' ', '%20') + "&body=" + email.replace('\n', '%0A')
|
73 |
return link
|
74 |
|
|
|
|
|
75 |
demo = gr.Blocks()
|
76 |
|
77 |
with demo:
|
@@ -97,12 +99,13 @@ with demo:
|
|
97 |
|
98 |
with gr.Row():
|
99 |
recipient_address = gr.Textbox(label="To", placeholder ="recipient's address")
|
100 |
-
link = gr.HTML("<a href=\"https://huggingface.co/spaces/KneeKhan/DSSG_Test\">
|
101 |
-
|
102 |
-
send_email = gr.Button("Send email!")
|
103 |
|
104 |
input_list = [sender, recipient, recipient_name, subject, email, model_id]
|
105 |
|
|
|
106 |
submit_button.click(pre_query, inputs = input_list, outputs=text_output)
|
107 |
-
send_email.click(set_email_link, inputs = [text_output, recipient_address, subject], outputs =
|
108 |
demo.launch(debug=True)
|
|
|
69 |
|
70 |
def set_email_link(email, recipient_address, subject):
|
71 |
email = email.replace(' ', '%20')
|
72 |
+
link = "<a href=\"" + "mailto:" + recipient_address + "?subject=" + subject.replace(' ', '%20') + "&body=" + email.replace('\n', '%0A') + "\">" + "Link generated!</a>"
|
73 |
return link
|
74 |
|
75 |
+
#def set_email_link_html():
|
76 |
+
|
77 |
demo = gr.Blocks()
|
78 |
|
79 |
with demo:
|
|
|
99 |
|
100 |
with gr.Row():
|
101 |
recipient_address = gr.Textbox(label="To", placeholder ="recipient's address")
|
102 |
+
#link = gr.HTML("<a href=\"https://huggingface.co/spaces/KneeKhan/DSSG_Test\">Link not generated</a>")
|
103 |
+
link = gr.HTML("<p>Link not generated</p>")
|
104 |
+
send_email = gr.Button("Send my email!")
|
105 |
|
106 |
input_list = [sender, recipient, recipient_name, subject, email, model_id]
|
107 |
|
108 |
+
#email_link.change(set_email_link_html, inputs = email_link, outputs=link)
|
109 |
submit_button.click(pre_query, inputs = input_list, outputs=text_output)
|
110 |
+
send_email.click(set_email_link, inputs = [text_output, recipient_address, subject], outputs = link)
|
111 |
demo.launch(debug=True)
|