Update routes/support.py
Browse files- routes/support.py +81 -92
routes/support.py
CHANGED
@@ -187,102 +187,91 @@ async def respond_ticket(
|
|
187 |
support_data = await support_resp.json()
|
188 |
support_name = support_data[0].get("name", "Support Team")
|
189 |
|
190 |
-
# E-mail HTML atualizado
|
191 |
email_html = f"""\
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
:
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
<td class="footer" style="padding: 20px 35px; font-size: 12px; color: #999999; text-align: center;">
|
272 |
-
<p style="margin: 0;">This is an automated email. Please reply directly to this message if you need further assistance.</p>
|
273 |
-
</td>
|
274 |
-
</tr>
|
275 |
-
</table>
|
276 |
-
</td>
|
277 |
-
</tr>
|
278 |
-
</table>
|
279 |
-
</body>
|
280 |
-
</html>
|
281 |
-
"""
|
282 |
|
283 |
# Envio de e-mail
|
284 |
access_token = await get_gmail_access_token()
|
285 |
-
subject = f"Support
|
286 |
|
287 |
raw_message = f"""To: {user_email}
|
288 |
From: "ClosetCoach" <[email protected]>
|
|
|
187 |
support_data = await support_resp.json()
|
188 |
support_name = support_data[0].get("name", "Support Team")
|
189 |
|
190 |
+
# E-mail HTML atualizado em inglês e sem borda branca
|
191 |
email_html = f"""\
|
192 |
+
<!DOCTYPE html>
|
193 |
+
<html lang="en">
|
194 |
+
<head>
|
195 |
+
<meta charset="UTF-8" />
|
196 |
+
<style>
|
197 |
+
body {{
|
198 |
+
margin: 0;
|
199 |
+
padding: 0;
|
200 |
+
background-color: #f4f4f4;
|
201 |
+
font-family: 'Arial', sans-serif;
|
202 |
+
}}
|
203 |
+
.email-container {{
|
204 |
+
width: 100%;
|
205 |
+
background-color: #f4f4f4;
|
206 |
+
padding: 30px 0;
|
207 |
+
}}
|
208 |
+
.email-content {{
|
209 |
+
width: 600px;
|
210 |
+
background-color: #ffffff;
|
211 |
+
margin: 0 auto;
|
212 |
+
padding: 40px;
|
213 |
+
border-radius: 8px;
|
214 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
215 |
+
}}
|
216 |
+
.email-header {{
|
217 |
+
text-align: right;
|
218 |
+
padding-bottom: 20px;
|
219 |
+
}}
|
220 |
+
.email-header img {{
|
221 |
+
width: 120px;
|
222 |
+
height: auto;
|
223 |
+
}}
|
224 |
+
.email-body {{
|
225 |
+
font-size: 16px;
|
226 |
+
line-height: 1.6;
|
227 |
+
color: #333;
|
228 |
+
margin-bottom: 30px;
|
229 |
+
}}
|
230 |
+
.email-body p {{
|
231 |
+
margin: 10px 0;
|
232 |
+
}}
|
233 |
+
.button {{
|
234 |
+
display: inline-block;
|
235 |
+
background-color: #007bff;
|
236 |
+
color: #ffffff;
|
237 |
+
padding: 12px 24px;
|
238 |
+
text-decoration: none;
|
239 |
+
border-radius: 5px;
|
240 |
+
font-weight: bold;
|
241 |
+
text-align: center;
|
242 |
+
margin-top: 20px;
|
243 |
+
}}
|
244 |
+
.footer {{
|
245 |
+
text-align: center;
|
246 |
+
font-size: 12px;
|
247 |
+
color: #888;
|
248 |
+
padding-top: 20px;
|
249 |
+
}}
|
250 |
+
</style>
|
251 |
+
</head>
|
252 |
+
<body>
|
253 |
+
<div class="email-container">
|
254 |
+
<div class="email-content">
|
255 |
+
<div class="email-header">
|
256 |
+
<img src="https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/saa-s-cloud-file-management-dashboard-u57zo5/assets/5l30gd1xml6i/Frame_1.png" alt="Logo" />
|
257 |
+
</div>
|
258 |
+
<div class="email-body">
|
259 |
+
<p>Hi {first_name},</p>
|
260 |
+
<p>{payload.content}</p>
|
261 |
+
<a href="https://www.instagram.com/ameddesbrasil" class="button">Follow us on Instagram</a>
|
262 |
+
</div>
|
263 |
+
<div class="footer">
|
264 |
+
<p>Best regards,<br>{support_name}<br>Customer Support</p>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
</div>
|
268 |
+
</body>
|
269 |
+
</html>
|
270 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
# Envio de e-mail
|
273 |
access_token = await get_gmail_access_token()
|
274 |
+
subject = f"Customer Support - Case {payload.ticket_id}"
|
275 |
|
276 |
raw_message = f"""To: {user_email}
|
277 |
From: "ClosetCoach" <[email protected]>
|