mails.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. REGISTER_MAIL = {
  2. "subject": "Bienvenido a Pedidos Express",
  3. "body": """
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>¡Bienvenido a {app_name}!</title>
  9. <style>
  10. body {{
  11. margin: 0;
  12. padding: 0;
  13. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  14. background-color: #f3f4f6;
  15. }}
  16. .email-container {{
  17. max-width: 600px;
  18. margin: 0 auto;
  19. background-color: #ffffff;
  20. border-radius: 12px;
  21. box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  22. overflow: hidden;
  23. }}
  24. .header {{
  25. background-color: #101419;
  26. color: white;
  27. padding: 32px;
  28. text-align: center;
  29. }}
  30. .header h1 {{
  31. margin: 0;
  32. font-size: 28px;
  33. font-weight: bold;
  34. }}
  35. .header p {{
  36. margin: 8px 0 0 0;
  37. font-size: 16px;
  38. opacity: 0.9;
  39. }}
  40. .content {{
  41. padding: 32px;
  42. }}
  43. .welcome-message {{
  44. text-align: center;
  45. margin-bottom: 32px;
  46. }}
  47. .welcome-message h2 {{
  48. color: #101419;
  49. font-size: 24px;
  50. margin: 0 0 12px 0;
  51. font-weight: bold;
  52. }}
  53. .welcome-message p {{
  54. color: #6b7280;
  55. font-size: 16px;
  56. line-height: 1.6;
  57. margin: 0;
  58. }}
  59. .benefits-section {{
  60. background-color: #f9fafb;
  61. border-radius: 8px;
  62. padding: 24px;
  63. margin: 24px 0;
  64. }}
  65. .benefits-title {{
  66. color: #101419;
  67. font-size: 18px;
  68. font-weight: 600;
  69. margin: 0 0 16px 0;
  70. text-align: center;
  71. }}
  72. .benefits-list {{
  73. list-style: none;
  74. padding: 0;
  75. margin: 0;
  76. }}
  77. .benefits-list li {{
  78. color: #374151;
  79. font-size: 14px;
  80. line-height: 1.5;
  81. margin-bottom: 8px;
  82. padding-left: 20px;
  83. position: relative;
  84. }}
  85. .benefits-list li:before {{
  86. content: "✓";
  87. color: #10b981;
  88. font-weight: bold;
  89. position: absolute;
  90. left: 0;
  91. }}
  92. .promo-section {{
  93. background: linear-gradient(135deg, #101419 0%, #37404a 100%);
  94. border-radius: 12px;
  95. padding: 32px;
  96. text-align: center;
  97. margin: 32px 0;
  98. color: white;
  99. }}
  100. .promo-amount {{
  101. font-size: 48px;
  102. font-weight: bold;
  103. margin: 16px 0;
  104. border: 3px solid white;
  105. border-radius: 8px;
  106. padding: 16px;
  107. display: inline-block;
  108. min-width: 120px;
  109. }}
  110. .promo-description {{
  111. font-size: 18px;
  112. margin: 16px 0;
  113. opacity: 0.95;
  114. }}
  115. .cta-button {{
  116. background-color: white;
  117. color: #101419;
  118. padding: 16px 32px;
  119. border-radius: 8px;
  120. text-decoration: none;
  121. font-weight: 600;
  122. font-size: 16px;
  123. display: inline-block;
  124. margin-top: 16px;
  125. transition: all 0.2s ease;
  126. }}
  127. .cta-button:hover {{
  128. background-color: #f3f4f6;
  129. transform: translateY(-1px);
  130. }}
  131. .website-section {{
  132. text-align: center;
  133. margin: 32px 0;
  134. padding: 24px;
  135. background-color: #f9fafb;
  136. border-radius: 8px;
  137. }}
  138. .website-url {{
  139. color: #101419;
  140. font-size: 20px;
  141. font-weight: 600;
  142. text-decoration: none;
  143. border-bottom: 2px solid #101419;
  144. padding-bottom: 4px;
  145. }}
  146. .footer {{
  147. background-color: #f9fafb;
  148. padding: 24px 32px;
  149. text-align: center;
  150. border-top: 1px solid #e5e7eb;
  151. }}
  152. .footer p {{
  153. color: #6b7280;
  154. font-size: 14px;
  155. margin: 0;
  156. line-height: 1.5;
  157. }}
  158. @media (max-width: 600px) {{
  159. .email-container {{
  160. margin: 0;
  161. border-radius: 0;
  162. }}
  163. .header, .content {{
  164. padding: 24px 16px;
  165. }}
  166. .promo-amount {{
  167. font-size: 36px;
  168. padding: 12px;
  169. }}
  170. }}
  171. </style>
  172. </head>
  173. <body>
  174. <div style="padding: 20px;">
  175. <div class="email-container">
  176. <!-- Header -->
  177. <div class="header">
  178. <h1>¡Hola {name}</h1>
  179. <p>Bienvenido a {app_name}</p>
  180. </div>
  181. <!-- Content -->
  182. <div class="content">
  183. <!-- Welcome Message -->
  184. <div class="welcome-message">
  185. <h2>Te damos la bienvenida a {app_name}</h2>
  186. <p>Tu registro ha sido exitoso. <br>Estamos emocionados de tenerte con nosotros. Esperamos que puedas disfrutar de nuestros beneficios.</p>
  187. </div>
  188. <!-- Benefits Section -->
  189. <div class="benefits-section">
  190. <h3 class="benefits-title">¿Qué puedes hacer con {app_name}?</h3>
  191. <ul class="benefits-list">
  192. <li>Realizar pedidos de forma rápida y sencilla</li>
  193. <li>Acceder a promociones exclusivas</li>
  194. <li>Disfrutar de una experiencia personalizada</li>
  195. <li>Usar nuestra inteligencia artificial</li>
  196. </ul>
  197. </div>
  198. <!-- Promo Section -->
  199. <div class="promo-section">
  200. <div class="promo-description">Este es tu pin de inicio de sesion</div>
  201. <div class="promo-amount">{pin}</div>
  202. <div class="promo-description">Guardalo muy bien</div>
  203. <a href="https://www.expressklein.com" class="cta-button">Y disfruta de {app_name}</a>
  204. </div>
  205. <!-- Website Section -->
  206. <div class="website-section">
  207. <p style="color: #6b7280; margin-bottom: 12px;">Visita nuestra plataforma:</p>
  208. <a href="https://www.expressklein.com" class="website-url">www.expressklein.com</a>
  209. </div>
  210. </div>
  211. <!-- Footer -->
  212. <div class="footer">
  213. <p>
  214. <strong>Express Klein</strong> - Tu aplicación de pedidos favorita<br>
  215. Si tienes alguna pregunta, no dudes en contactarnos.<br>
  216. © 2025 Express Klein. Todos los derechos reservados.
  217. </p>
  218. </div>
  219. </div>
  220. </div>
  221. </body>
  222. </html>
  223. """
  224. }
  225. PRINTER_DISCONNECTED_MAIL = {
  226. "subject": "Printer Disconnected",
  227. "body": """
  228. <!DOCTYPE html>
  229. <html>
  230. <head>
  231. <meta charset="UTF-8">
  232. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  233. <title>Alerta: Impresora Desconectada - KlowApp</title>
  234. </head>
  235. <body style="margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f3f4f6;">
  236. <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #f3f4f6; padding: 20px;">
  237. <tr>
  238. <td align="center">
  239. <table width="600" cellpadding="0" cellspacing="0" style="max-width: 600px; background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);">
  240. <!-- Header -->
  241. <tr>
  242. <td style="background-color: #dc2626; color: white; padding: 32px; text-align: center;">
  243. <h1 style="margin: 0; font-size: 28px; font-weight: bold;">🚨 Alerta del Sistema</h1>
  244. <p style="margin: 8px 0 0 0; font-size: 16px; opacity: 0.9;">Notificación para Desarrolladores</p>
  245. </td>
  246. </tr>
  247. <!-- Content -->
  248. <tr>
  249. <td style="padding: 32px;">
  250. <!-- Alert Message -->
  251. <table width="100%" cellpadding="0" cellspacing="0">
  252. <tr>
  253. <td style="text-align: center; margin-bottom: 32px;">
  254. <h2 style="color: #dc2626; font-size: 24px; margin: 0 0 12px 0; font-weight: bold;">Impresora Desconectada</h2>
  255. <p style="color: #6b7280; font-size: 16px; line-height: 1.6; margin: 0;">Se ha detectado una desconexión en el sistema de impresión de {restaurant_name}.</p>
  256. </td>
  257. </tr>
  258. </table>
  259. <!-- Alert Details -->
  260. <table width="100%" cellpadding="0" cellspacing="0" style="margin: 24px 0;">
  261. <tr>
  262. <td style="background-color: #fef2f2; border-radius: 8px; padding: 24px; border-left: 4px solid #dc2626;">
  263. <h3 style="color: #dc2626; font-size: 18px; font-weight: 600; margin: 0 0 16px 0;">Detalles del Problema</h3>
  264. <ul style="list-style: none; padding: 0; margin: 0;">
  265. <li style="color: #374151; font-size: 14px; line-height: 1.5; margin-bottom: 8px; padding-left: 20px; position: relative;">
  266. <span style="color: #dc2626; font-weight: bold; position: absolute; left: 0;">🖨️</span>
  267. <strong>Impresora:</strong> {printer_name}
  268. </li>
  269. <li style="color: #374151; font-size: 14px; line-height: 1.5; margin-bottom: 8px; padding-left: 20px; position: relative;">
  270. <span style="color: #dc2626; font-weight: bold; position: absolute; left: 0;">⏰</span>
  271. <strong>Hora de desconexión:</strong> {timestamp}
  272. </li>
  273. </ul>
  274. </td>
  275. </tr>
  276. </table>
  277. <!-- Priority Section -->
  278. <table width="100%" cellpadding="0" cellspacing="0">
  279. <tr>
  280. <td style="background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); border-radius: 12px; padding: 32px; text-align: center; margin: 32px 0; color: white;">
  281. <p style="font-size: 18px; margin: 0 0 16px 0; opacity: 0.95;">Estado del Sistema</p>
  282. <div style="font-size: 32px; font-weight: bold; margin: 16px 0; border: 3px solid white; border-radius: 8px; padding: 16px; display: inline-block; min-width: 200px; background-color: rgba(255,255,255,0.1);">
  283. 🔴 CRÍTICO
  284. </div>
  285. <p style="font-size: 16px; margin: 16px 0 0 0; opacity: 0.9;">Requiere atención inmediata</p>
  286. </td>
  287. </tr>
  288. </table>
  289. <!-- Impact Assessment -->
  290. <table width="100%" cellpadding="0" cellspacing="0" style="margin: 32px 0;">
  291. <tr>
  292. <td style="background-color: #fff7ed; border-radius: 8px; padding: 24px; border-left: 4px solid #f59e0b;">
  293. <h3 style="color: #92400e; font-size: 16px; font-weight: 600; margin: 0 0 12px 0;">Impacto Potencial</h3>
  294. <p style="color: #374151; font-size: 14px; line-height: 1.5; margin: 0;">
  295. ⚠️ Los pedidos no se están imprimiendo automáticamente<br>
  296. ⚠️ El restaurante puede estar perdiendo órdenes<br>
  297. ⚠️ Se requiere intervención manual inmediata<br>
  298. ⚠️ Posible pérdida de ingresos y experiencia del cliente
  299. </p>
  300. </td>
  301. </tr>
  302. </table>
  303. <!-- Action Items -->
  304. <table width="100%" cellpadding="0" cellspacing="0" style="margin: 32px 0;">
  305. <tr>
  306. <td style="background-color: #f0f9ff; border-radius: 8px; padding: 24px; border-left: 4px solid #3b82f6;">
  307. <h3 style="color: #1e40af; font-size: 16px; font-weight: 600; margin: 0 0 12px 0;">Acciones Requeridas</h3>
  308. <p style="color: #374151; font-size: 14px; line-height: 1.5; margin: 0;">
  309. 1. <strong>Verificar</strong> la conexión de red de la impresora<br>
  310. 2. <strong>Contactar</strong> al restaurante para confirmar el estado<br>
  311. 3. <strong>Reiniciar</strong> el servicio de impresión si es necesario<br>
  312. 4. <strong>Monitorear</strong> la reconexión y funcionalidad<br>
  313. 5. <strong>Documentar</strong> la resolución en el sistema
  314. </p>
  315. </td>
  316. </tr>
  317. </table>
  318. </td>
  319. </tr>
  320. <!-- Footer -->
  321. <tr>
  322. <td style="background-color: #f9fafb; padding: 24px 32px; text-align: center; border-top: 1px solid #e5e7eb;">
  323. <p style="color: #6b7280; font-size: 14px; margin: 0; line-height: 1.5;">
  324. <strong>Express Klein - Sistema de Monitoreo</strong><br>
  325. Alerta automática generada el {timestamp}<br>
  326. Este es un email automático del sistema de monitoreo.<br>
  327. © 2025 Express Klein. Todos los derechos reservados.
  328. </p>
  329. </td>
  330. </tr>
  331. </table>
  332. </td>
  333. </tr>
  334. </table>
  335. </body>
  336. </html>
  337. """
  338. }
  339. PIN_RECOVERTY_MAIL = {
  340. "subject": "Recuperación de PIN | Pedidos Express",
  341. "body": """
  342. <!DOCTYPE html>
  343. <html>
  344. <head>
  345. <meta charset="UTF-8">
  346. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  347. <title>Recupera tu PIN </title>
  348. </head>
  349. <body style="margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f3f4f6;">
  350. <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #f3f4f6; padding: 20px;">
  351. <tr>
  352. <td align="center">
  353. <table width="600" cellpadding="0" cellspacing="0" style="max-width: 600px; background-color: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);">
  354. <!-- Header -->
  355. <tr>
  356. <td style="background-color: #101419; color: white; padding: 32px; text-align: center;">
  357. <h1 style="margin: 0; font-size: 28px; font-weight: bold;">¡Hola {name}!</h1>
  358. <p style="margin: 8px 0 0 0; font-size: 16px; opacity: 0.9;">Recuperación de PIN</p>
  359. </td>
  360. </tr>
  361. <!-- Content -->
  362. <tr>
  363. <td style="padding: 32px;">
  364. <!-- Welcome Message -->
  365. <table width="100%" cellpadding="0" cellspacing="0">
  366. <tr>
  367. <td style="text-align: center; margin-bottom: 32px;">
  368. <h2 style="color: #101419; font-size: 24px; margin: 0 0 12px 0; font-weight: bold;">¿Olvidaste tu PIN?</h2>
  369. <p style="color: #6b7280; font-size: 16px; line-height: 1.6; margin: 0;">No te preocupes, puedes crear un nuevo PIN de acceso a {app_name}.</p>
  370. </td>
  371. </tr>
  372. </table>
  373. <!-- Security Info -->
  374. <table width="100%" cellpadding="0" cellspacing="0" style="margin: 24px 0;">
  375. <tr>
  376. <td style="background-color: #f9fafb; border-radius: 8px; padding: 24px;">
  377. <h3 style="color: #101419; font-size: 18px; font-weight: 600; margin: 0 0 16px 0; text-align: center;">Información Importante</h3>
  378. <ul style="list-style: none; padding: 0; margin: 0;">
  379. <li style="color: #374151; font-size: 14px; line-height: 1.5; margin-bottom: 8px; padding-left: 20px; position: relative;">
  380. <span style="color: #10b981; font-weight: bold; position: absolute; left: 0;">✓</span>
  381. Este enlace es válido por 24 horas
  382. </li>
  383. <li style="color: #374151; font-size: 14px; line-height: 1.5; margin-bottom: 8px; padding-left: 20px; position: relative;">
  384. <span style="color: #10b981; font-weight: bold; position: absolute; left: 0;">✓</span>
  385. Podrás elegir tu nuevo PIN
  386. </li>
  387. <li style="color: #374151; font-size: 14px; line-height: 1.5; margin-bottom: 8px; padding-left: 20px; position: relative;">
  388. <span style="color: #10b981; font-weight: bold; position: absolute; left: 0;">✓</span>
  389. Si no solicitaste este cambio, ignora este correo
  390. </li>
  391. </ul>
  392. </td>
  393. </tr>
  394. </table>
  395. <!-- Reset PIN Section -->
  396. <table width="100%" cellpadding="0" cellspacing="0">
  397. <tr>
  398. <td style="background: linear-gradient(135deg, #101419 0%, #37404a 100%); border-radius: 12px; padding: 32px; text-align: center; margin: 32px 0; color: white;">
  399. <p style="font-size: 18px; margin: 0 0 16px 0; opacity: 0.95;">Haz clic en el botón para crear tu nuevo PIN</p>
  400. <div style="font-size: 24px; font-weight: bold; margin: 16px 0; border: 3px solid white; border-radius: 8px; padding: 16px; display: inline-block; min-width: 200px; background-color: rgba(255,255,255,0.1);">
  401. 🔐 Restablecer PIN
  402. </div>
  403. <p style="font-size: 16px; margin: 16px 0 0 0; opacity: 0.9;">Podrás elegir un nuevo PIN de tu preferencia</p>
  404. <table width="100%" cellpadding="0" cellspacing="0" style="margin-top: 20px;">
  405. <tr>
  406. <td align="center">
  407. <a href="{reset_pin_url}" style="background-color: white; color: #101419; padding: 16px 32px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 16px; display: inline-block;">
  408. Crear Nuevo PIN
  409. </a>
  410. </td>
  411. </tr>
  412. </table>
  413. </td>
  414. </tr>
  415. </table>
  416. <!-- Next Steps -->
  417. <table width="100%" cellpadding="0" cellspacing="0" style="margin: 32px 0;">
  418. <tr>
  419. <td style="background-color: #f0f9ff; border-radius: 8px; padding: 24px; border-left: 4px solid #3b82f6;">
  420. <h3 style="color: #101419; font-size: 16px; font-weight: 600; margin: 0 0 12px 0;">¿Qué sigue?</h3>
  421. <p style="color: #374151; font-size: 14px; line-height: 1.5; margin: 0;">
  422. 1. Haz clic en "Crear Nuevo PIN"<br>
  423. 2. Elige un PIN fácil de recordar pero seguro<br>
  424. 3. Ingresa a {app_name} con tu nuevo PIN<br>
  425. 4. ¡Disfruta de todos nuestros beneficios!
  426. </p>
  427. </td>
  428. </tr>
  429. </table>
  430. <!-- Website Section -->
  431. <table width="100%" cellpadding="0" cellspacing="0">
  432. <tr>
  433. <td style="text-align: center; margin: 32px 0; padding: 24px; background-color: #f9fafb; border-radius: 8px;">
  434. <p style="color: #6b7280; margin: 0 0 12px 0;">Visita nuestra plataforma:</p>
  435. <a href="https://www.expressklein.com" style="color: #101419; font-size: 20px; font-weight: 600; text-decoration: none; border-bottom: 2px solid #101419; padding-bottom: 4px;">
  436. www.expressklein.com
  437. </a>
  438. </td>
  439. </tr>
  440. </table>
  441. </td>
  442. </tr>
  443. <!-- Footer -->
  444. <tr>
  445. <td style="background-color: #f9fafb; padding: 24px 32px; text-align: center; border-top: 1px solid #e5e7eb;">
  446. <p style="color: #6b7280; font-size: 14px; margin: 0; line-height: 1.5;">
  447. <strong>Express Klein</strong> - Tu aplicación de pedidos favorita<br>
  448. Este enlace de restablecimiento expira en 24 horas.<br>
  449. Si no solicitaste este cambio, puedes ignorar este correo.<br>
  450. © 2025 Express Klein. Todos los derechos reservados.
  451. </p>
  452. </td>
  453. </tr>
  454. </table>
  455. </td>
  456. </tr>
  457. </table>
  458. </body>
  459. </html>
  460. """
  461. }