gigafibre-fsm/services/targo-hub/lib/email-templates.js
louispaulb c6b2dd1491 refactor: extract composables from 5 largest files — net -1950 lines from main components
DispatchPage.vue: 1320→1217 lines
  - Extract SbModal.vue + SbContextMenu.vue reusable components
  - Extract useAbsenceResize composable
  - Extract dispatch constants to config/dispatch.js

ProjectWizard.vue: 1185→673 lines (-43%)
  - Extract useWizardPublish composable (270-line publish function)
  - Extract useWizardCatalog composable
  - Extract wizard-constants.js (step labels, options, categories)

SettingsPage.vue: 1172→850 lines (-27%)
  - Extract usePermissionMatrix composable
  - Extract useUserGroups composable
  - Extract useLegacySync composable

ClientDetailPage.vue: 1169→864 lines (-26%)
  - Extract useClientData composable (loadCustomer broken into sub-functions)
  - Extract useEquipmentActions composable
  - Extract client-constants.js + erp-pdf.js utility

checkout.js: 639→408 lines (-36%)
  - Extract address-search.js module
  - Extract otp.js module
  - Extract email-templates.js module
  - Extract project-templates.js module
  - Add erpQuery() helper to DRY repeated URL construction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 17:57:24 -04:00

34 lines
2.0 KiB
JavaScript

'use strict'
function otpEmailHtml (code) {
return `<div style="font-family:system-ui;max-width:400px;margin:0 auto;padding:24px">
<h2 style="color:#3949ab;margin:0 0 16px">Vérification</h2>
<p style="color:#334155;font-size:14px">Votre code de vérification est :</p>
<div style="font-size:32px;font-weight:700;letter-spacing:8px;text-align:center;padding:16px;background:#f1f5f9;border-radius:8px;color:#1e293b">${code}</div>
<p style="color:#94a3b8;font-size:12px;margin-top:16px">Ce code expire dans 10 minutes.</p>
</div>`
}
function orderConfirmationHtml ({ orderName, customer_name, itemRows, preferred_date, preferred_slot }) {
return `<!DOCTYPE html><html><head><meta charset="utf-8"></head><body style="font-family:system-ui;margin:0;padding:0;background:#f1f5f9">
<div style="max-width:560px;margin:0 auto;padding:24px">
<div style="background:white;border-radius:16px;overflow:hidden;box-shadow:0 4px 24px rgba(0,0,0,0.06)">
<div style="background:linear-gradient(135deg,#22c55e,#16a34a);color:white;padding:24px 28px">
<h1 style="margin:0;font-size:20px">Commande confirm&eacute;e</h1>
<p style="margin:6px 0 0;opacity:0.85;font-size:13px">${orderName || 'Merci pour votre commande'}</p>
</div>
<div style="padding:24px 28px">
<p style="color:#334155;font-size:14px;margin:0 0 16px">Bonjour ${customer_name},</p>
<table style="width:100%;border-collapse:collapse;font-size:14px"><tbody>${itemRows}</tbody></table>
${preferred_date ? `<p style="margin:16px 0 0;color:#475569;font-size:13px"><strong>Date souhait&eacute;e :</strong> ${preferred_date} ${preferred_slot || ''}</p>` : ''}
<p style="margin:16px 0 0;color:#475569;font-size:13px">Nous vous contacterons pour confirmer les d&eacute;tails.</p>
</div>
<div style="border-top:1px solid #e2e8f0;padding:16px 28px;text-align:center">
<p style="color:#94a3b8;font-size:11px;margin:0">Gigafibre — Targo T&eacute;l&eacute;communications</p>
</div>
</div>
</div></body></html>`
}
module.exports = { otpEmailHtml, orderConfirmationHtml }