Update routes/support.py
Browse files- routes/support.py +15 -36
routes/support.py
CHANGED
@@ -195,9 +195,9 @@ async def respond_ticket(
|
|
195 |
user_name = user_data[0].get("name", "user").strip()
|
196 |
first_name = user_name.split(" ")[0] if user_name else "user"
|
197 |
|
198 |
-
# 4. Send email with updated HTML template
|
199 |
access_token = await get_gmail_access_token()
|
200 |
-
subject = f"Customer Support - Case {payload.ticket_id}"
|
201 |
|
202 |
email_html = f"""
|
203 |
<!DOCTYPE html>
|
@@ -206,22 +206,22 @@ async def respond_ticket(
|
|
206 |
<meta charset="UTF-8" />
|
207 |
</head>
|
208 |
<body style="margin:0;padding:0;background-color:#f5f5f5;">
|
209 |
-
<table width="
|
210 |
<tbody>
|
211 |
<tr>
|
212 |
<td width="100%">
|
213 |
-
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" style="margin:0 auto;border:1px solid #d2d2d2;border-radius:
|
214 |
<tbody>
|
215 |
<tr>
|
216 |
-
<td bgcolor="#ffffff" width="100%" height="
|
217 |
</tr>
|
218 |
<tr>
|
219 |
-
<td align="right" bgcolor="#ffffff" style="padding:0
|
220 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
221 |
<tbody>
|
222 |
<tr>
|
223 |
-
<td bgcolor="#ffffff" align="right" height="
|
224 |
-
<img src="https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/saa-s-cloud-file-management-dashboard-u57zo5/assets/5l30gd1xml6i/Frame_1.png" width="
|
225 |
</td>
|
226 |
</tr>
|
227 |
</tbody>
|
@@ -229,36 +229,15 @@ async def respond_ticket(
|
|
229 |
</td>
|
230 |
</tr>
|
231 |
<tr>
|
232 |
-
<td bgcolor="#ffffff" style="padding:
|
233 |
-
<table>
|
234 |
<tbody>
|
235 |
<tr>
|
236 |
-
<td
|
237 |
-
<
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
|
242 |
-
<tbody>
|
243 |
-
<tr>
|
244 |
-
<td style="padding:7px 0 19px;margin:0;font-family:Helvetica Neue,Helvetica,Arial,Verdana,sans-serif;color:#797979;font-size:14px;line-height:1.6em;word-wrap:break-word">
|
245 |
-
<p style="color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px">Hello {first_name},</p>
|
246 |
-
<p style="min-height:16.0px;color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px"><br></p>
|
247 |
-
{payload.content}
|
248 |
-
<p style="min-height:16.0px;color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px"><br></p>
|
249 |
-
<p style="color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px">If you have additional questions related to this request, please refer to case number {payload.ticket_id}.</p>
|
250 |
-
<p style="min-height:16.0px;color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px"><br></p>
|
251 |
-
<p style="color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px">Best regards,</p>
|
252 |
-
<p style="color:rgba(0,0,0,0.85);min-height:16.0px;margin:0.0px 0.0px 0.0px 0.0px"><br></p>
|
253 |
-
<p style="color:rgba(0,0,0,0.85);margin:0.0px 0.0px 0.0px 0.0px">{support_name}<br>Customer Support</p>
|
254 |
-
</td>
|
255 |
-
</tr>
|
256 |
-
</tbody>
|
257 |
-
</table>
|
258 |
-
</td>
|
259 |
-
</tr>
|
260 |
-
</tbody>
|
261 |
-
</table>
|
262 |
</td>
|
263 |
</tr>
|
264 |
</tbody>
|
|
|
195 |
user_name = user_data[0].get("name", "user").strip()
|
196 |
first_name = user_name.split(" ")[0] if user_name else "user"
|
197 |
|
198 |
+
# 4. Send email with updated HTML template
|
199 |
access_token = await get_gmail_access_token()
|
200 |
+
subject = f"Customer Support - Case {payload.ticket_id}"
|
201 |
|
202 |
email_html = f"""
|
203 |
<!DOCTYPE html>
|
|
|
206 |
<meta charset="UTF-8" />
|
207 |
</head>
|
208 |
<body style="margin:0;padding:0;background-color:#f5f5f5;">
|
209 |
+
<table width="650" border="0" cellspacing="0" cellpadding="0" align="center" style="margin:0 auto">
|
210 |
<tbody>
|
211 |
<tr>
|
212 |
<td width="100%">
|
213 |
+
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" style="margin:0 auto;border:1px solid #d2d2d2;border-radius:4px">
|
214 |
<tbody>
|
215 |
<tr>
|
216 |
+
<td bgcolor="#ffffff" width="100%" height="15"></td>
|
217 |
</tr>
|
218 |
<tr>
|
219 |
+
<td align="right" bgcolor="#ffffff" style="padding:0 15px 0 15px">
|
220 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
221 |
<tbody>
|
222 |
<tr>
|
223 |
+
<td bgcolor="#ffffff" align="right" height="24" style="display:block">
|
224 |
+
<img src="https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/saa-s-cloud-file-management-dashboard-u57zo5/assets/5l30gd1xml6i/Frame_1.png" width="26" height="14" border="0" alt="" />
|
225 |
</td>
|
226 |
</tr>
|
227 |
</tbody>
|
|
|
229 |
</td>
|
230 |
</tr>
|
231 |
<tr>
|
232 |
+
<td bgcolor="#ffffff" style="padding:15px 30px 30px">
|
233 |
+
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
|
234 |
<tbody>
|
235 |
<tr>
|
236 |
+
<td style="font-family:Helvetica Neue,Helvetica,Arial,Verdana,sans-serif;color:#333333;font-size:14px;line-height:1.6;word-wrap:break-word">
|
237 |
+
<p style="margin:0 0 12px 0">Hello {first_name},</p>
|
238 |
+
{payload.content}
|
239 |
+
<p style="margin:16px 0 0 0">Best regards,</p>
|
240 |
+
<p style="margin:4px 0 0 0">{support_name}<br>Customer Support</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
</td>
|
242 |
</tr>
|
243 |
</tbody>
|