Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,6 +32,7 @@ Trendy Sweet Shop"""
|
|
32 |
email_template = ""
|
33 |
|
34 |
# Replace the placeholders with the input values.
|
|
|
35 |
email_template = email_template.replace("[variable: customer name]", customer_name if customer_name else "")
|
36 |
email_template = email_template.replace("[variable: out of stock product]", out_of_stock if out_of_stock else "")
|
37 |
email_template = email_template.replace("[variable: dispatched product]", dispatched if dispatched else "")
|
@@ -63,13 +64,4 @@ with gr.Blocks(title="Email Generator") as demo:
|
|
63 |
outputs=email_output
|
64 |
)
|
65 |
|
66 |
-
|
67 |
-
gr.HTML("""
|
68 |
-
<div style="margin-top: 10px;">
|
69 |
-
<button onclick="navigator.clipboard.writeText(document.querySelector('textarea[aria-label=\\"Generated Email\\"]').value)">
|
70 |
-
Copy Email
|
71 |
-
</button>
|
72 |
-
</div>
|
73 |
-
""")
|
74 |
-
|
75 |
-
demo.launch()
|
|
|
32 |
email_template = ""
|
33 |
|
34 |
# Replace the placeholders with the input values.
|
35 |
+
# If no value is provided, the placeholder will be replaced with an empty string.
|
36 |
email_template = email_template.replace("[variable: customer name]", customer_name if customer_name else "")
|
37 |
email_template = email_template.replace("[variable: out of stock product]", out_of_stock if out_of_stock else "")
|
38 |
email_template = email_template.replace("[variable: dispatched product]", dispatched if dispatched else "")
|
|
|
64 |
outputs=email_output
|
65 |
)
|
66 |
|
67 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|