INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Recordatorio — Clase de {{course_name}} · {{session_date}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#1a4a8a;\\">📅 Tu clase comienza pronto</h2>\\r\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\r\\n  <p>Tienes una sesión de <strong>{{course_name}}</strong> programada para:</p>\\r\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\r\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p><p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Sala: <strong>{{breakout_room}}</strong></p>\\r\\n  </div>\\r\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\r\\n    <a href=\\"{{zoom_link}}\\"\\r\\n       style=\\"background:#1a4a8a;color:white;padding:14px 28px;\\r\\n              text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">\\r\\n      🎥 Unirse a la clase\\r\\n    </a>\\r\\n  </div>\\r\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ Este enlace es único y personal — no lo compartas.</p><p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{student_name}}, tienes clase de {{course_name}} el {{session_date}}.\\n\\nZoom: {{zoom_link}}\\nEste enlace es único y personal — no lo compartas.\\n\\nSala: {{breakout_room}}", "updated_at": "2026-05-27T15:30:26.947649+02:00", "template_key": "CLASS_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Reminder — {{course_name}} class · {{session_date}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">📅 Your class starts soon</h2>\\n  <p>Hi <strong>{{student_name}}</strong>,</p>\\n  <p>You have a <strong>{{course_name}}</strong> session scheduled for:</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p><p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Breakout room: <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\"\\n       style=\\"background:#1a4a8a;color:white;padding:14px 28px;\\n              text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">\\n      🎥 Join the class\\n    </a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{student_name}}, you have a {{course_name}} class on {{session_date}}.\\n\\nZoom: {{zoom_link}}\\nThis link is unique and personal — please do not share it.\\n\\nBreakout room: {{breakout_room}}", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "CLASS_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Rappel — Cours de {{course_name}} · {{session_date}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">📅 Votre cours commence bientôt</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>Vous avez une session de <strong>{{course_name}}</strong> prévue le :</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p><p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Salle : <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\"\\n       style=\\"background:#1a4a8a;color:white;padding:14px 28px;\\n              text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">\\n      🎥 Rejoindre le cours\\n    </a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{student_name}}, vous avez un cours de {{course_name}} le {{session_date}}.\\n\\nZoom : {{zoom_link}}\\nCe lien est unique et personnel — merci de ne pas le partager.\\n\\nSalle : {{breakout_room}}", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "CLASS_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Promemoria — Lezione di {{course_name}} · {{session_date}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">📅 La tua lezione inizia presto</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>Hai una sessione di <strong>{{course_name}}</strong> programmata per:</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p><p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Sala: <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\"\\n       style=\\"background:#1a4a8a;color:white;padding:14px 28px;\\n              text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">\\n      🎥 Unisciti alla lezione\\n    </a>\\n  </div>\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ Questo link è unico e personale — non condividerlo.</p><p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{student_name}}, hai una lezione di {{course_name}} il {{session_date}}.\\n\\nZoom: {{zoom_link}}\\nQuesto link è unico e personale — non condividerlo.\\n\\nSala: {{breakout_room}}", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "CLASS_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Mensaje de STC — {{course_name}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><p>Hola <strong>{{partner_name}}</strong>,</p><p>[Escribe tu mensaje aquí]</p><p style=\\"color:#666;font-size:.9em;\\">Saludos,<br>Equipo STC</p></div>", "body_text": "Hola {{partner_name}},\\n\\n[Escribe tu mensaje aquí]\\n\\nSaludos,\\nEquipo STC", "updated_at": "2026-07-23T12:30:21.414421+02:00", "template_key": "CONTACT_GENERAL"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Message from STC — {{course_name}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><p>Hi <strong>{{partner_name}}</strong>,</p><p>[Write your message here]</p><p style=\\"color:#666;font-size:.9em;\\">Best regards,<br>STC Team</p></div>", "body_text": "Hi {{partner_name}},\\n\\n[Write your message here]\\n\\nBest regards,\\nSTC Team", "updated_at": "2026-07-23T12:30:21.414421+02:00", "template_key": "CONTACT_GENERAL"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Messaggio da STC — {{course_name}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><p>Ciao <strong>{{partner_name}}</strong>,</p><p>[Scrivi il tuo messaggio qui]</p><p style=\\"color:#666;font-size:.9em;\\">Cordiali saluti,<br>Team STC</p></div>", "body_text": "Ciao {{partner_name}},\\n\\n[Scrivi il tuo messaggio qui]\\n\\nCordiali saluti,\\nTeam STC", "updated_at": "2026-07-23T12:30:21.414421+02:00", "template_key": "CONTACT_GENERAL"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Message de STC — {{course_name}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>[Écrivez votre message ici]</p><p style=\\"color:#666;font-size:.9em;\\">Cordialement,<br>Équipe STC</p></div>", "body_text": "Bonjour {{partner_name}},\\n\\n[Écrivez votre message ici]\\n\\nCordialement,\\nÉquipe STC", "updated_at": "2026-07-23T12:30:21.414421+02:00", "template_key": "CONTACT_GENERAL"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, '{"active": true, "subject": "Benvenuto al STC — La tua iscrizione è confermata", "language": "it", "body_html": "<h2>Benvenuto al STC!</h2><p>Ciao <strong>{{student_name}}</strong>,</p><p>La tua iscrizione a <strong>{{course_name}}</strong> è stata confermata.</p><p><strong>MOLTO IMPORTANTE!</strong></p><p>SIATE PUNTUALI!! Una volta iniziata la riunione, dopo 3 minuti la sala verrà chiusa. Tenete la fotocamera attivata... 😃</p><p></p><p><strong>Il tuo tutor:</strong> {{tutor_name}}</p><p><strong>Contatto:</strong> {{tutor_email}}</p><p>Riceverete presto ulteriori informazioni sulle prossime sessioni.</p><p>Sistema STC — Zinzino</p>", "body_text": "Ciao {{student_name}}, la tua iscrizione a {{course_name}} è confermata. Il tuo tutor è {{tutor_name}} ({{tutor_email}}).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, '{"active": true, "subject": "Welcome to STC — Your enrolment is confirmed", "language": "en", "body_html": "<h2>Welcome to STC!</h2><p>Hi <strong>{{student_name}}</strong>,</p><p>Your enrolment in <strong>{{course_name}}</strong> has been confirmed.</p><p><strong>VERY IMPORTANT!</strong></p><p>PLEASE BE PUNCTUAL!! Once the meeting starts, after 3 minutes the room will be closed. Please keep your camera on... 😃</p><p></p><p><strong>Your tutor:</strong> {{tutor_name}}</p><p><strong>Contact:</strong> {{tutor_email}}</p><p>You will soon receive more information about upcoming sessions.</p><p>STC System — Zinzino</p>", "body_text": "Hi {{student_name}}, your enrolment in {{course_name}} is confirmed. Your tutor is {{tutor_name}} ({{tutor_email}}).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, '{"active": true, "subject": "Bienvenue au STC — Votre inscription est confirmée", "language": "fr", "body_html": "<h2>Bienvenue au STC !</h2><p>Bonjour <strong>{{student_name}}</strong>,</p><p>Votre inscription à <strong>{{course_name}}</strong> a été confirmée.</p><p><strong>TRÈS IMPORTANT !</strong></p><p>SOYEZ PONCTUEL(LE) !! Une fois la réunion commencée, la salle sera fermée après 3 minutes. Gardez votre caméra activée... 😃</p><p></p><p><strong>Votre tuteur :</strong> {{tutor_name}}</p><p><strong>Contact :</strong> {{tutor_email}}</p><p>Vous recevrez bientôt plus d''informations sur les prochaines sessions.</p><p>Système STC — Zinzino</p>", "body_text": "Bonjour {{student_name}}, votre inscription à {{course_name}} est confirmée. Votre tuteur est {{tutor_name}} ({{tutor_email}}).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, '{"active": true, "subject": "Bienvenido al STC — Tu inscripción está confirmada", "language": "es", "body_html": "<h2>¡Bienvenido al STC!</h2><p>Hola <strong>{{student_name}}</strong>,</p><p>Tu inscripción en <strong>{{course_name}}</strong> ha sido confirmada.</p><p>¡¡¡MUY IMPORTANTE!!</p><p>POR FAVOR  DEBES SER PUNTUAL !! UNA VEZ EMPIECE LA REUNION , PASADOS 3 MINUTOS SE CIERRA LA SALA Y TEN ACTIVADA LA CAMARA ... 😃</p><p></p><p><strong>Tu tutor:</strong> {{tutor_name}}</p><p><strong>Contacto:</strong> {{tutor_email}}</p><p>Pronto recibirás más información sobre las próximas sesiones.</p><p>Sistema STC — Zinzino</p>", "body_text": "Hola {{student_name}}, tu inscripción en {{course_name}} está confirmada. Tu tutor es {{tutor_name}} ({{tutor_email}}).", "updated_at": "2026-06-09T17:14:30.424311+02:00", "template_key": "ENROLLMENT_ACTIVE_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Nuova iscrizione — {{student_name}} in {{course_name}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">✅ Nuova iscrizione registrata</h2>\\n  <p>Ciao <strong>{{tutor_name}}</strong>,</p>\\n  <p>Un nuovo studente si è iscritto al tuo gruppo di <strong>{{course_name}}</strong>:</p>\\n  <div style=\\"background:#f5f5f5;padding:15px;border-radius:8px;margin:20px 0;\\">\\n    <p style=\\"margin:0;\\"><strong>Studente:</strong> {{student_name}}</p>\\n    <p style=\\"margin:5px 0 0;\\"><strong>Email:</strong> {{student_email}}</p>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{tutor_name}}, {{student_name}} ({{student_email}}) si è iscritto/a a {{course_name}}.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "New enrolment — {{student_name}} in {{course_name}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">✅ New enrolment registered</h2>\\n  <p>Hi <strong>{{tutor_name}}</strong>,</p>\\n  <p>A new student has enrolled in your <strong>{{course_name}}</strong> group:</p>\\n  <div style=\\"background:#f5f5f5;padding:15px;border-radius:8px;margin:20px 0;\\">\\n    <p style=\\"margin:0;\\"><strong>Student:</strong> {{student_name}}</p>\\n    <p style=\\"margin:5px 0 0;\\"><strong>Email:</strong> {{student_email}}</p>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{tutor_name}}, {{student_name}} ({{student_email}}) has enrolled in {{course_name}}.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Nouvelle inscription — {{student_name}} dans {{course_name}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">✅ Nouvelle inscription enregistrée</h2>\\n  <p>Bonjour <strong>{{tutor_name}}</strong>,</p>\\n  <p>Un nouvel élève s''est inscrit dans votre groupe de <strong>{{course_name}}</strong> :</p>\\n  <div style=\\"background:#f5f5f5;padding:15px;border-radius:8px;margin:20px 0;\\">\\n    <p style=\\"margin:0;\\"><strong>Élève :</strong> {{student_name}}</p>\\n    <p style=\\"margin:5px 0 0;\\"><strong>Email :</strong> {{student_email}}</p>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{tutor_name}}, {{student_name}} ({{student_email}}) s''est inscrit(e) dans {{course_name}}.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_ACTIVE_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Nueva inscripción — {{student_name}} en {{course_name}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#2c5f2e;\\">✅ Nueva inscripción registrada</h2>\\r\\n  <p>Hola <strong>{{tutor_name}}</strong>,</p>\\r\\n  <p>Se ha inscrito un nuevo alumno en tu grupo de <strong>{{course_name}}</strong>:</p>\\r\\n  <div style=\\"background:#f5f5f5;padding:15px;border-radius:8px;margin:20px 0;\\">\\r\\n    <p style=\\"margin:0;\\"><strong>Alumno:</strong> {{student_name}}</p>\\r\\n    <p style=\\"margin:5px 0 0;\\"><strong>Email:</strong> {{student_email}}</p>\\r\\n  </div>\\r\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{tutor_name}}, {{student_name}} ({{student_email}}) se ha inscrito en {{course_name}}.", "updated_at": "2026-05-26T15:08:11.218679+02:00", "template_key": "ENROLLMENT_ACTIVE_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Lista de espera — {{course_name}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#e67e22;\\">⏳ En lista de espera</h2>\\r\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\r\\n  <p>Has sido registrado en la lista de espera para <strong>{{course_name}}</strong>.</p>\\r\\n  <p>Te notificaremos en cuanto haya una plaza disponible.</p>\\r\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{student_name}}, estás en lista de espera para {{course_name}}. Te avisaremos cuando haya plaza.", "updated_at": "2026-05-26T15:08:11.218679+02:00", "template_key": "ENROLLMENT_PENDING_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Lista d''attesa — {{course_name}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ In lista d''attesa</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>Sei stato/a registrato/a nella lista d''attesa per <strong>{{course_name}}</strong>.</p>\\n  <p>Ti notificheremo non appena si libera un posto.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{student_name}}, sei in lista d''attesa per {{course_name}}. Ti avviseremo appena si libera un posto.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Liste d''attente — {{course_name}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ En liste d''attente</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>Vous avez été inscrit(e) sur la liste d''attente pour <strong>{{course_name}}</strong>.</p>\\n  <p>Nous vous notifierons dès qu''une place sera disponible.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{student_name}}, vous êtes sur la liste d''attente pour {{course_name}}. Nous vous préviendrons dès qu''une place sera disponible.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Waiting list — {{course_name}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ On the waiting list</h2>\\n  <p>Hi <strong>{{student_name}}</strong>,</p>\\n  <p>You have been registered on the waiting list for <strong>{{course_name}}</strong>.</p>\\n  <p>We will notify you as soon as a spot becomes available.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{student_name}}, you are on the waiting list for {{course_name}}. We will notify you when a spot becomes available.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Student on waiting list — {{student_name}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ Student on waiting list</h2>\\n  <p>Hi <strong>{{tutor_name}}</strong>,</p>\\n  <p><strong>{{student_name}}</strong> has tried to enrol in <strong>{{course_name}}</strong>\\n     but the group is full.</p>\\n  <p>They have been added to the waiting list.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{tutor_name}}, {{student_name}} is on the waiting list for {{course_name}} (group full).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Élève en liste d''attente — {{student_name}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ Élève en liste d''attente</h2>\\n  <p>Bonjour <strong>{{tutor_name}}</strong>,</p>\\n  <p><strong>{{student_name}}</strong> a essayé de s''inscrire à <strong>{{course_name}}</strong>\\n     mais le groupe est complet.</p>\\n  <p>Il/elle a été ajouté(e) à la liste d''attente.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{tutor_name}}, {{student_name}} est en liste d''attente pour {{course_name}} (groupe complet).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Studente in lista d''attesa — {{student_name}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#e67e22;\\">⏳ Studente in lista d''attesa</h2>\\n  <p>Ciao <strong>{{tutor_name}}</strong>,</p>\\n  <p><strong>{{student_name}}</strong> ha tentato di iscriversi a <strong>{{course_name}}</strong>\\n     ma il gruppo è al completo.</p>\\n  <p>È stato/a aggiunto/a alla lista d''attesa.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{tutor_name}}, {{student_name}} è in lista d''attesa per {{course_name}} (gruppo al completo).", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_PENDING_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Alumno en lista de espera — {{student_name}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#e67e22;\\">⏳ Alumno en lista de espera</h2>\\r\\n  <p>Hola <strong>{{tutor_name}}</strong>,</p>\\r\\n  <p><strong>{{student_name}}</strong> ha intentado inscribirse en <strong>{{course_name}}</strong>\\r\\n     pero el grupo está completo.</p>\\r\\n  <p>Ha sido añadido a la lista de espera.</p>\\r\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{tutor_name}}, {{student_name}} está en lista de espera para {{course_name}} (grupo lleno).", "updated_at": "2026-05-26T15:08:11.218679+02:00", "template_key": "ENROLLMENT_PENDING_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Iscrizione non elaborata", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c0392b;\\">⚠️ Iscrizione non elaborata</h2>\\n  <p>Ciao <strong>{{tutor_name}}</strong>,</p>\\n  <p>L''iscrizione di <strong>{{student_name}}</strong> a <strong>{{course_name}}</strong>\\n     non ha potuto essere elaborata.</p>\\n  <p>Contatta l''amministratore se il problema persiste.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{tutor_name}}, l''iscrizione di {{student_name}} a {{course_name}} non ha potuto essere elaborata.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_REJECTED_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Inscripción no procesada", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#c0392b;\\">⚠️ Inscripción no procesada</h2>\\r\\n  <p>Hola <strong>{{tutor_name}}</strong>,</p>\\r\\n  <p>La inscripción de <strong>{{student_name}}</strong> en <strong>{{course_name}}</strong>\\r\\n     no ha podido ser procesada.</p>\\r\\n  <p>Por favor, contacta con el administrador si el problema persiste.</p>\\r\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{tutor_name}}, la inscripción de {{student_name}} en {{course_name}} no pudo ser procesada.", "updated_at": "2026-05-26T15:08:11.218679+02:00", "template_key": "ENROLLMENT_REJECTED_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Enrolment not processed", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c0392b;\\">⚠️ Enrolment not processed</h2>\\n  <p>Hi <strong>{{tutor_name}}</strong>,</p>\\n  <p>The enrolment of <strong>{{student_name}}</strong> in <strong>{{course_name}}</strong>\\n     could not be processed.</p>\\n  <p>Please contact the administrator if the problem persists.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{tutor_name}}, the enrolment of {{student_name}} in {{course_name}} could not be processed.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_REJECTED_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Inscription non traitée", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c0392b;\\">⚠️ Inscription non traitée</h2>\\n  <p>Bonjour <strong>{{tutor_name}}</strong>,</p>\\n  <p>L''inscription de <strong>{{student_name}}</strong> dans <strong>{{course_name}}</strong>\\n     n''a pas pu être traitée.</p>\\n  <p>Veuillez contacter l''administrateur si le problème persiste.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{tutor_name}}, l''inscription de {{student_name}} dans {{course_name}} n''a pas pu être traitée.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "ENROLLMENT_REJECTED_TUTOR"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "🎉 ¡Tu cuenta STC ha sido activada!", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\r\\n  <h2 style=\\"color:#2c5f2e;\\">🎉 ¡Cuenta activada!</h2>\\r\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\r\\n  <p>Ya eres Partner activo en el Sistema de Formación Continua de Zinzino.</p>\\r\\n  <p>Accede a <a href=\\"https://stc.stc-eu.com\\">stc.stc-eu.com</a> con tu cuenta Google\\r\\n     para ver tu panel de alumno.</p>\\r\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\r\\n</div>", "body_text": "Hola {{student_name}}, ya eres Partner activo en STC. Accede en stc.stc-eu.com.", "updated_at": "2026-05-26T15:08:11.218679+02:00", "template_key": "GUEST_PROMOTED_PARTNER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "🎉 Your STC account has been activated!", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">🎉 Account activated!</h2>\\n  <p>Hi <strong>{{student_name}}</strong>,</p>\\n  <p>You are now an active Partner in the Zinzino Continuous Training System.</p>\\n  <p>Access <a href=\\"https://stc.stc-eu.com\\">stc.stc-eu.com</a> with your Google account\\n     to view your student dashboard.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hi {{student_name}}, you are now an active Partner in STC. Access at stc.stc-eu.com.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "GUEST_PROMOTED_PARTNER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "🎉 Votre compte STC a été activé !", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">🎉 Compte activé !</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>Vous êtes maintenant un Partner actif du Système de Formation Continue de Zinzino.</p>\\n  <p>Accédez à <a href=\\"https://stc.stc-eu.com\\">stc.stc-eu.com</a> avec votre compte Google\\n     pour consulter votre tableau de bord étudiant.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{student_name}}, vous êtes maintenant un Partner actif dans STC. Connectez-vous sur stc.stc-eu.com.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "GUEST_PROMOTED_PARTNER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "🎉 Il tuo account STC è stato attivato!", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2c5f2e;\\">🎉 Account attivato!</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>Sei ora un Partner attivo nel Sistema di Formazione Continua di Zinzino.</p>\\n  <p>Accedi a <a href=\\"https://stc.stc-eu.com\\">stc.stc-eu.com</a> con il tuo account Google\\n     per visualizzare il tuo pannello studente.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{student_name}}, sei ora un Partner attivo in STC. Accedi su stc.stc-eu.com.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "GUEST_PROMOTED_PARTNER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Sesión cancelada — {{course_name}} · {{session_date}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c62828;\\">❌ Sesión cancelada</h2>\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\n  <p>La sesión de <strong>{{course_name}}</strong> programada para el <strong>{{session_date}}</strong><br><small style=\\"color:#1a4a8a;font-weight:500\\">{{session_date_local}}</small> ha sido cancelada.</p>\\n  <div style=\\"background:#fdecea;padding:15px;border-radius:8px;margin:20px 0;border-left:4px solid #c62828;\\">\\n    <p style=\\"margin:0;color:#c62828;font-weight:bold;\\">Motivo</p>\\n    <p style=\\"margin:8px 0 0 0;color:#333;\\">{{reason}}</p>\\n  </div>\\n  <p>Recibirás un aviso cuando se programe una nueva sesión.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Hola {{student_name}}, la sesión de {{course_name}} del {{session_date}} ha sido cancelada. Motivo: {{reason}}", "updated_at": "2026-06-25T15:19:42.433061+02:00", "template_key": "SESSION_CANCELLED_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Session cancelled — {{course_name}} · {{session_date}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c62828;\\">❌ Session cancelled</h2>\\n  <p>Hello <strong>{{student_name}}</strong>,</p>\\n  <p>The <strong>{{course_name}}</strong> session scheduled for <strong>{{session_date}}</strong><br><small style=\\"color:#1a4a8a;font-weight:500\\">{{session_date_local}}</small> has been cancelled.</p>\\n  <div style=\\"background:#fdecea;padding:15px;border-radius:8px;margin:20px 0;border-left:4px solid #c62828;\\">\\n    <p style=\\"margin:0;color:#c62828;font-weight:bold;\\">Reason</p>\\n    <p style=\\"margin:8px 0 0 0;color:#333;\\">{{reason}}</p>\\n  </div>\\n  <p>You will be notified when a new session is scheduled.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hello {{student_name}}, the {{course_name}} session on {{session_date}} has been cancelled. Reason: {{reason}}", "updated_at": "2026-06-25T15:19:42.433061+02:00", "template_key": "SESSION_CANCELLED_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Séance annulée — {{course_name}} · {{session_date}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c62828;\\">❌ Séance annulée</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>La séance de <strong>{{course_name}}</strong> prévue le <strong>{{session_date}}</strong><br><small style=\\"color:#1a4a8a;font-weight:500\\">{{session_date_local}}</small> a été annulée.</p>\\n  <div style=\\"background:#fdecea;padding:15px;border-radius:8px;margin:20px 0;border-left:4px solid #c62828;\\">\\n    <p style=\\"margin:0;color:#c62828;font-weight:bold;\\">Motif</p>\\n    <p style=\\"margin:8px 0 0 0;color:#333;\\">{{reason}}</p>\\n  </div>\\n  <p>Vous serez informé(e) lorsqu''une nouvelle séance sera programmée.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{student_name}}, la séance de {{course_name}} du {{session_date}} a été annulée. Motif : {{reason}}", "updated_at": "2026-06-25T15:19:42.433061+02:00", "template_key": "SESSION_CANCELLED_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Sessione annullata — {{course_name}} · {{session_date}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#c62828;\\">❌ Sessione annullata</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>La sessione di <strong>{{course_name}}</strong> prevista per <strong>{{session_date}}</strong><br><small style=\\"color:#1a4a8a;font-weight:500\\">{{session_date_local}}</small> è stata annullata.</p>\\n  <div style=\\"background:#fdecea;padding:15px;border-radius:8px;margin:20px 0;border-left:4px solid #c62828;\\">\\n    <p style=\\"margin:0;color:#c62828;font-weight:bold;\\">Motivo</p>\\n    <p style=\\"margin:8px 0 0 0;color:#333;\\">{{reason}}</p>\\n  </div>\\n  <p>Riceverai una notifica quando verrà programmata una nuova sessione.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{student_name}}, la sessione di {{course_name}} del {{session_date}} è stata annullata. Motivo: {{reason}}", "updated_at": "2026-06-25T15:19:42.433061+02:00", "template_key": "SESSION_CANCELLED_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Your {{course_name}} class starts soon — {{session_date}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">⏰ Your class starts soon</h2>\\n  <p>Hi <strong>{{student_name}}</strong>,</p>\\n  <p>Just a reminder that your <strong>{{course_name}}</strong> session is coming up:</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p>\\n    <p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Room: <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\" style=\\"background:#1a4a8a;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">🎥 Join the class</a>\\n  </div>\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ This link is unique and personal — do not share it.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Your {{course_name}} class starts soon — {{session_date}}. Link: {{zoom_link}}", "updated_at": "2026-07-16T18:08:32.905153+02:00", "template_key": "SESSION_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Tu clase de {{course_name}} empieza pronto — {{session_date}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">⏰ Tu clase empieza pronto</h2>\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\n  <p>Te recordamos que tienes una sesión de <strong>{{course_name}}</strong> programada para:</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p>\\n    <p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Sala: <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\" style=\\"background:#1a4a8a;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">🎥 Unirse a la clase</a>\\n  </div>\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ Este enlace es único y personal — no lo compartas.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Tu clase de {{course_name}} empieza pronto — {{session_date}}. Enlace: {{zoom_link}}", "updated_at": "2026-07-16T18:08:32.905153+02:00", "template_key": "SESSION_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Votre cours de {{course_name}} commence bientôt — {{session_date}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">⏰ Votre cours commence bientôt</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>Rappel : vous avez une séance de <strong>{{course_name}}</strong> prévue pour :</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p>\\n    <p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Salle : <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\" style=\\"background:#1a4a8a;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">🎥 Rejoindre le cours</a>\\n  </div>\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ Ce lien est unique et personnel — ne le partagez pas.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Votre cours de {{course_name}} commence bientôt — {{session_date}}. Lien : {{zoom_link}}", "updated_at": "2026-07-16T18:08:32.905153+02:00", "template_key": "SESSION_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "La tua lezione di {{course_name}} inizia presto — {{session_date}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">⏰ La tua lezione inizia presto</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>Ti ricordiamo che hai una sessione di <strong>{{course_name}}</strong> in programma per:</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"font-size:1.2em;font-weight:bold;margin:0;\\">{{session_date}}</p>\\n    <p style=\\"font-size:.95em;color:#1a4a8a;font-weight:500;margin:8px 0 0 0;\\">{{session_date_local}}</p>\\n    <p style=\\"font-size:.9em;color:#555;margin:8px 0 0 0;display:{{breakout_room_display}}\\">Sala: <strong>{{breakout_room}}</strong></p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"{{zoom_link}}\\" style=\\"background:#1a4a8a;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">🎥 Entra nella lezione</a>\\n  </div>\\n  <p style=\\"color:#888;font-size:.85em;text-align:center;\\">⚠️ Questo link è unico e personale — non condividerlo.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "La tua lezione di {{course_name}} inizia presto — {{session_date}}. Link: {{zoom_link}}", "updated_at": "2026-07-16T18:08:32.905153+02:00", "template_key": "SESSION_REMINDER_STUDENT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Avviso: studente già assegnato a un altro tutor", "language": "it", "body_html": "<p>Salve,</p>\\n   <p>Il tutor <strong>{{tutor_name}}</strong> ({{tutor_email}}) ha tentato di iscrivere lo studente\\n   <strong>{{student_name}}</strong> ({{student_email}}) che è già assegnato a un altro tutor.</p>\\n   <p>Si prega di verificare la situazione dal pannello di amministrazione.</p>", "body_text": "Il tutor {{tutor_name}} ha tentato di iscrivere {{student_name}} che è già assegnato a un altro tutor.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "STUDENT_CONFLICT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Warning: student already assigned to another tutor", "language": "en", "body_html": "<p>Hello,</p>\\n   <p>Tutor <strong>{{tutor_name}}</strong> ({{tutor_email}}) has attempted to enrol student\\n   <strong>{{student_name}}</strong> ({{student_email}}) who is already assigned to another tutor.</p>\\n   <p>Please review the situation from the administration panel.</p>", "body_text": "Tutor {{tutor_name}} has attempted to enrol student {{student_name}} who is already assigned to another tutor.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "STUDENT_CONFLICT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Avertissement : élève déjà assigné à un autre tuteur", "language": "fr", "body_html": "<p>Bonjour,</p>\\n   <p>Le tuteur <strong>{{tutor_name}}</strong> ({{tutor_email}}) a tenté d''inscrire l''élève\\n   <strong>{{student_name}}</strong> ({{student_email}}) qui est déjà assigné(e) à un autre tuteur.</p>\\n   <p>Veuillez examiner la situation depuis le panneau d''administration.</p>", "body_text": "Le tuteur {{tutor_name}} a tenté d''inscrire {{student_name}} qui est déjà assigné(e) à un autre tuteur.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "STUDENT_CONFLICT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Aviso: alumno ya asignado a otro tutor", "language": "es", "body_html": "<p>Hola,</p>\\r\\n   <p>El tutor <strong>{{tutor_name}}</strong> ({{tutor_email}}) ha intentado inscribir al alumno\\r\\n   <strong>{{student_name}}</strong> ({{student_email}}) que ya está asignado a otro tutor.</p>\\r\\n   <p>Por favor, revisa la situación desde el panel de administración.</p>", "body_text": "El tutor {{tutor_name}} ha intentado inscribir al alumno {{student_name}} que ya está asignado a otro tutor.", "updated_at": "2026-05-29T15:48:18.264151+02:00", "template_key": "STUDENT_CONFLICT"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Êtes-vous prêt à progresser dans {{course_name}} ?", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">🎯 Vérifiez vos progrès</h2>\\n  <p>Bonjour <strong>{{student_name}}</strong>,</p>\\n  <p>Comment avance votre formation dans <strong>{{course_name}}</strong> ?</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1em;color:#555;\\">Niveau actuel</p>\\n    <p style=\\"margin:6px 0 0 0;font-size:1.2em;font-weight:bold;\\">{{level_name}}</p>\\n  </div>\\n  <p>Si vous pensez être prêt à passer au niveau suivant, discutez-en avec votre tuteur lors de la prochaine session.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{student_name}}, comment avance votre formation dans {{course_name}} ? Niveau actuel : {{level_name}}. Si vous pensez être prêt, parlez-en à votre tuteur.", "updated_at": "2026-07-15T15:28:20.878772+02:00", "template_key": "STUDENT_LEVEL_CHECK"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Are you ready to advance in {{course_name}}?", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">🎯 Check your progress</h2>\\n  <p>Hello <strong>{{student_name}}</strong>,</p>\\n  <p>How is your training going in <strong>{{course_name}}</strong>?</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1em;color:#555;\\">Current level</p>\\n    <p style=\\"margin:6px 0 0 0;font-size:1.2em;font-weight:bold;\\">{{level_name}}</p>\\n  </div>\\n  <p>If you think you''re ready to advance to the next level, let your tutor know at the next session.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hello {{student_name}}, how is your training going in {{course_name}}? Current level: {{level_name}}. If you think you are ready to advance, let your tutor know.", "updated_at": "2026-07-15T15:28:20.878772+02:00", "template_key": "STUDENT_LEVEL_CHECK"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Sei pronto per avanzare in {{course_name}}?", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">🎯 Controlla i tuoi progressi</h2>\\n  <p>Ciao <strong>{{student_name}}</strong>,</p>\\n  <p>Come sta andando la tua formazione in <strong>{{course_name}}</strong>?</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1em;color:#555;\\">Livello attuale</p>\\n    <p style=\\"margin:6px 0 0 0;font-size:1.2em;font-weight:bold;\\">{{level_name}}</p>\\n  </div>\\n  <p>Se pensi di essere pronto per avanzare al livello successivo, parlane con il tuo tutor nella prossima sessione.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{student_name}}, come sta andando la tua formazione in {{course_name}}? Livello attuale: {{level_name}}. Se sei pronto per avanzare, parla con il tuo tutor.", "updated_at": "2026-07-15T15:28:20.878772+02:00", "template_key": "STUDENT_LEVEL_CHECK"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — ¿Estás listo para avanzar en {{course_name}}?", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#1a4a8a;\\">🎯 Comprueba tu progreso</h2>\\n  <p>Hola <strong>{{student_name}}</strong>,</p>\\n  <p>¿Cómo va tu formación en <strong>{{course_name}}</strong>?</p>\\n  <div style=\\"background:#e8f0fe;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1em;color:#555;\\">Nivel actual</p>\\n    <p style=\\"margin:6px 0 0 0;font-size:1.2em;font-weight:bold;\\">{{level_name}}</p>\\n  </div>\\n  <p>Si crees que estás listo para avanzar al siguiente nivel, coméntalo con tu tutor en la próxima sesión.</p>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Hola {{student_name}}, ¿cómo va tu formación en {{course_name}}? Nivel actual: {{level_name}}. Si crees que estás listo para avanzar, coméntalo con tu tutor.", "updated_at": "2026-07-15T15:28:20.878772+02:00", "template_key": "STUDENT_LEVEL_CHECK"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Révision des niveaux de vos élèves", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2e7d32;\\">📋 Révision pré-session</h2>\\n  <p>Bonjour <strong>{{tutor_name}}</strong>,</p>\\n  <p>Il est temps de vérifier l''état et le niveau de vos élèves dans <strong>{{course_name}}</strong> avant la prochaine session.</p>\\n  <div style=\\"background:#e8f5e9;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1.1em;\\">Vous avez <strong>{{active_student_count}}</strong> élève(s) actif(s).</p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"https://stc.stc-eu.com\\" style=\\"background:#2e7d32;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">Accéder au STC</a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p>\\n</div>", "body_text": "Bonjour {{tutor_name}}, il est temps de vérifier les niveaux de vos {{active_student_count}} élève(s) actif(s) dans {{course_name}}. Accédez sur https://stc.stc-eu.com", "updated_at": "2026-07-15T15:28:20.843958+02:00", "template_key": "TUTOR_PREP_REMINDER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Review your students'' levels", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2e7d32;\\">📋 Pre-session review</h2>\\n  <p>Hello <strong>{{tutor_name}}</strong>,</p>\\n  <p>It''s time to review the status and level of your students in <strong>{{course_name}}</strong> before the next session.</p>\\n  <div style=\\"background:#e8f5e9;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1.1em;\\">You have <strong>{{active_student_count}}</strong> active student(s).</p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"https://stc.stc-eu.com\\" style=\\"background:#2e7d32;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">Go to STC</a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p>\\n</div>", "body_text": "Hello {{tutor_name}}, time to review the levels of your {{active_student_count}} active student(s) in {{course_name}}. Access at https://stc.stc-eu.com", "updated_at": "2026-07-15T15:28:20.843958+02:00", "template_key": "TUTOR_PREP_REMINDER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Revisione dei livelli dei tuoi studenti", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2e7d32;\\">📋 Revisione pre-sessione</h2>\\n  <p>Ciao <strong>{{tutor_name}}</strong>,</p>\\n  <p>È il momento di verificare lo stato e il livello dei tuoi studenti in <strong>{{course_name}}</strong> prima della prossima sessione.</p>\\n  <div style=\\"background:#e8f5e9;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1.1em;\\">Hai <strong>{{active_student_count}}</strong> studente/i attivo/i.</p>\\n  </div>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"https://stc.stc-eu.com\\" style=\\"background:#2e7d32;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">Accedi al STC</a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Ciao {{tutor_name}}, è il momento di verificare i livelli dei tuoi {{active_student_count}} studente/i attivo/i in {{course_name}}. Accedi su https://stc.stc-eu.com", "updated_at": "2026-07-15T15:28:20.843958+02:00", "template_key": "TUTOR_PREP_REMINDER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "STC — Revisión de niveles de tus alumnos", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\">\\n  <h2 style=\\"color:#2e7d32;\\">📋 Revisión pre-sesión</h2>\\n  <p>Hola <strong>{{tutor_name}}</strong>,</p>\\n  <p>Es momento de revisar el estado y nivel de tus alumnos en <strong>{{course_name}}</strong> antes de la próxima sesión.</p>\\n  <div style=\\"background:#e8f5e9;padding:15px;border-radius:8px;margin:20px 0;text-align:center;\\">\\n    <p style=\\"margin:0;font-size:1.1em;\\">Tienes <strong>{{active_student_count}}</strong> alumno(s) activo(s).</p>\\n  </div>\\n  <p>Accede al sistema para gestionar los niveles y el estado de tus alumnos:</p>\\n  <div style=\\"text-align:center;margin:30px 0;\\">\\n    <a href=\\"https://stc.stc-eu.com\\" style=\\"background:#2e7d32;color:white;padding:14px 28px;text-decoration:none;border-radius:6px;font-size:1.1em;display:inline-block;\\">Acceder al STC</a>\\n  </div>\\n  <p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p>\\n</div>", "body_text": "Hola {{tutor_name}}, es momento de revisar los niveles de tus {{active_student_count}} alumno(s) activo(s) en {{course_name}}. Accede en https://stc.stc-eu.com", "updated_at": "2026-07-15T15:28:20.843958+02:00", "template_key": "TUTOR_PREP_REMINDER"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Bienvenido al STC, {{tutor_name}}", "language": "es", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><h2 style=\\"color:#1a4a8a;\\">Bienvenido al Sistema STC</h2><p>Hola <strong>{{tutor_name}}</strong>,</p><p>Tu registro como tutor en <strong>{{course_name}}</strong> se ha completado correctamente.</p><p>Ya puedes acceder al sistema e inscribir a tus alumnos desde tu panel.</p><p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p></div>", "body_text": "Hola {{tutor_name}}, tu registro como tutor en {{course_name}} se ha completado. Ya puedes acceder al sistema.", "updated_at": "2026-06-09T11:45:05.516558+02:00", "template_key": "TUTOR_REGISTERED"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Benvenuto al STC, {{tutor_name}}", "language": "it", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><h2 style=\\"color:#1a4a8a;\\">Benvenuto nel Sistema STC</h2><p>Ciao <strong>{{tutor_name}}</strong>,</p><p>La tua registrazione come tutor in <strong>{{course_name}}</strong> è stata completata con successo.</p><p>Ora puoi accedere al sistema e iscrivere i tuoi studenti dal tuo pannello.</p><p style=\\"color:#666;font-size:.9em;\\">Sistema STC — Zinzino</p></div>", "body_text": "Ciao {{tutor_name}}, la tua registrazione come tutor in {{course_name}} è stata completata. Ora puoi accedere al sistema.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "TUTOR_REGISTERED"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Bienvenue au STC, {{tutor_name}}", "language": "fr", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><h2 style=\\"color:#1a4a8a;\\">Bienvenue dans le Système STC</h2><p>Bonjour <strong>{{tutor_name}}</strong>,</p><p>Votre inscription en tant que tuteur dans <strong>{{course_name}}</strong> a été complétée avec succès.</p><p>Vous pouvez désormais accéder au système et inscrire vos élèves depuis votre tableau de bord.</p><p style=\\"color:#666;font-size:.9em;\\">Système STC — Zinzino</p></div>", "body_text": "Bonjour {{tutor_name}}, votre inscription comme tuteur dans {{course_name}} est terminée. Vous pouvez maintenant accéder au système.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "TUTOR_REGISTERED"}') ON CONFLICT DO NOTHING;
INSERT INTO public.email_templates
SELECT * FROM jsonb_populate_record(NULL::public.email_templates, E'{"active": true, "subject": "Welcome to STC, {{tutor_name}}", "language": "en", "body_html": "<div style=\\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;\\"><h2 style=\\"color:#1a4a8a;\\">Welcome to the STC System</h2><p>Hi <strong>{{tutor_name}}</strong>,</p><p>Your registration as a tutor in <strong>{{course_name}}</strong> has been completed successfully.</p><p>You can now access the system and enrol your students from your dashboard.</p><p style=\\"color:#666;font-size:.9em;\\">STC System — Zinzino</p></div>", "body_text": "Hi {{tutor_name}}, your registration as a tutor in {{course_name}} has been completed. You can now access the system.", "updated_at": "2026-06-19T10:12:46.161388+02:00", "template_key": "TUTOR_REGISTERED"}') ON CONFLICT DO NOTHING;

-- ============================================================
-- Contact templates (manual outreach from professor/tutor)
-- Placeholder: {{partner_name}}
-- ============================================================

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_WELCOME', 'es', 'Bienvenido/a al programa de formación STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">¡Bienvenido/a al STC!</h2><p>Hola <strong>{{partner_name}}</strong>,</p><p>Me alegra que te hayas unido al programa de formación STC de Zinzino. En las próximas sesiones trabajaremos juntos para que puedas sacar el máximo partido a tu negocio.</p><p>Si tienes cualquier pregunta antes de la primera sesión, no dudes en escribirme.</p><p style="color:#666;font-size:.9em;">Un saludo,<br>Equipo STC</p></div>',
 E'Hola {{partner_name}},\n\nMe alegra que te hayas unido al programa STC. Trabajaremos juntos para potenciar tu negocio Zinzino.\n\nSi tienes cualquier pregunta antes de empezar, no dudes en escribirme.\n\nUn saludo,\nEquipo STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_WELCOME', 'en', 'Welcome to the STC training programme',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">Welcome to STC!</h2><p>Hi <strong>{{partner_name}}</strong>,</p><p>We are delighted to have you in the STC training programme. In our upcoming sessions we will work together to help you get the most out of your Zinzino business.</p><p>If you have any questions before the first session, feel free to reach out.</p><p style="color:#666;font-size:.9em;">Best regards,<br>STC Team</p></div>',
 E'Hi {{partner_name}},\n\nWelcome to the STC training programme. We will work together to help you get the most out of your Zinzino business.\n\nIf you have any questions before we start, feel free to reach out.\n\nBest regards,\nSTC Team',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_WELCOME', 'fr', 'Bienvenue dans le programme de formation STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">Bienvenue au STC !</h2><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>Nous sommes ravis de vous accueillir dans le programme de formation STC de Zinzino. Lors de nos prochaines séances, nous travaillerons ensemble pour développer votre activité.</p><p>Si vous avez des questions avant la première séance, n''hésitez pas à nous écrire.</p><p style="color:#666;font-size:.9em;">Cordialement,<br>Équipe STC</p></div>',
 E'Bonjour {{partner_name}},\n\nBienvenue dans le programme STC. Nous travaillerons ensemble pour développer votre activité Zinzino.\n\nSi vous avez des questions avant de commencer, n''hésitez pas à nous contacter.\n\nCordialement,\nÉquipe STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_WELCOME', 'it', 'Benvenuto/a nel programma di formazione STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">Benvenuto/a al STC!</h2><p>Ciao <strong>{{partner_name}}</strong>,</p><p>Siamo felici di averti nel programma di formazione STC di Zinzino. Nelle prossime sessioni lavoreremo insieme per aiutarti a sviluppare al meglio la tua attività.</p><p>Se hai domande prima della prima sessione, non esitare a scriverci.</p><p style="color:#666;font-size:.9em;">Cordiali saluti,<br>Team STC</p></div>',
 E'Ciao {{partner_name}},\n\nBenvenuto/a nel programma STC. Lavoreremo insieme per sviluppare la tua attività Zinzino.\n\nSe hai domande prima di iniziare, non esitare a contattarci.\n\nCordiali saluti,\nTeam STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_ABSENCE', 'es', 'Te echamos de menos en la sesión de hoy',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#e67e22;">¿Todo bien?</h2><p>Hola <strong>{{partner_name}}</strong>,</p><p>Hemos notado que no has podido asistir a la sesión de hoy. No te preocupes, estas cosas pasan. Nos gustaría saber cómo estás y si necesitas ayuda para ponerte al día.</p><p>¿Cuándo tienes disponibilidad para que lo retomemos?</p><p style="color:#666;font-size:.9em;">Un saludo,<br>Equipo STC</p></div>',
 E'Hola {{partner_name}},\n\nHemos notado que no has podido asistir a la sesión de hoy. No te preocupes, estas cosas pasan.\n\n¿Cuándo tienes disponibilidad para que lo retomemos?\n\nUn saludo,\nEquipo STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_ABSENCE', 'en', 'We missed you at today''s session',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#e67e22;">Is everything OK?</h2><p>Hi <strong>{{partner_name}}</strong>,</p><p>We noticed you were not able to attend today''s session. No worries — these things happen. We would love to know how you are doing and whether you need any support to catch up.</p><p>When would be a good time to get back on track?</p><p style="color:#666;font-size:.9em;">Best regards,<br>STC Team</p></div>',
 E'Hi {{partner_name}},\n\nWe noticed you were not able to attend today''s session. No worries — these things happen.\n\nWhen would be a good time to catch up?\n\nBest regards,\nSTC Team',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_ABSENCE', 'fr', 'Vous nous avez manqué à la séance d''aujourd''hui',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#e67e22;">Tout va bien ?</h2><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>Nous avons remarqué que vous n''avez pas pu assister à la séance d''aujourd''hui. Pas d''inquiétude, ça arrive à tout le monde. Nous aimerions savoir comment vous allez et si vous avez besoin d''aide pour rattraper la matière.</p><p>Quand seriez-vous disponible pour que l''on reprenne ?</p><p style="color:#666;font-size:.9em;">Cordialement,<br>Équipe STC</p></div>',
 E'Bonjour {{partner_name}},\n\nNous avons remarqué votre absence à la séance d''aujourd''hui. Pas d''inquiétude.\n\nQuand seriez-vous disponible pour rattraper ?\n\nCordialement,\nÉquipe STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_ABSENCE', 'it', 'Ci sei mancato/a alla sessione di oggi',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#e67e22;">Tutto bene?</h2><p>Ciao <strong>{{partner_name}}</strong>,</p><p>Abbiamo notato che non hai potuto partecipare alla sessione di oggi. Non preoccuparti, può succedere. Ci farebbe piacere sapere come stai e se hai bisogno di supporto per recuperare.</p><p>Quando saresti disponibile per riprendere?</p><p style="color:#666;font-size:.9em;">Cordiali saluti,<br>Team STC</p></div>',
 E'Ciao {{partner_name}},\n\nAbbiamo notato che non hai potuto partecipare alla sessione di oggi. Non preoccuparti.\n\nQuando saresti disponibile per recuperare?\n\nCordiali saluti,\nTeam STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_FOLLOWUP', 'es', 'Seguimiento tras la última sesión',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">¿Qué tal la sesión?</h2><p>Hola <strong>{{partner_name}}</strong>,</p><p>Nos ponemos en contacto para ver qué tal te fue en la última sesión. Esperamos que los contenidos hayan sido de utilidad para tu día a día.</p><p>Si tienes alguna duda o quieres profundizar en algún tema, estamos aquí para ayudarte.</p><p style="color:#666;font-size:.9em;">Un saludo,<br>Equipo STC</p></div>',
 E'Hola {{partner_name}},\n\nNos ponemos en contacto para saber cómo te fue en la última sesión. Esperamos que los contenidos hayan sido de utilidad.\n\nSi tienes alguna duda, estamos aquí para ayudarte.\n\nUn saludo,\nEquipo STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_FOLLOWUP', 'en', 'Follow-up after the last session',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">How did the session go?</h2><p>Hi <strong>{{partner_name}}</strong>,</p><p>We are reaching out to check in after the last session. We hope the content was useful for your day-to-day work.</p><p>If you have any questions or would like to dive deeper into any topic, we are here to help.</p><p style="color:#666;font-size:.9em;">Best regards,<br>STC Team</p></div>',
 E'Hi {{partner_name}},\n\nChecking in after the last session. We hope the content was useful.\n\nIf you have any questions or want to go deeper into any topic, we are here to help.\n\nBest regards,\nSTC Team',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_FOLLOWUP', 'fr', 'Suivi après la dernière séance',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">Comment s''est passée la séance ?</h2><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>Nous prenons contact pour voir comment s''est passée la dernière séance. Nous espérons que le contenu vous a été utile au quotidien.</p><p>Si vous avez des questions ou souhaitez approfondir un sujet, n''hésitez pas à nous écrire.</p><p style="color:#666;font-size:.9em;">Cordialement,<br>Équipe STC</p></div>',
 E'Bonjour {{partner_name}},\n\nNous prenons contact pour voir comment s''est passée la dernière séance. Nous espérons que le contenu vous a été utile.\n\nSi vous avez des questions, n''hésitez pas à nous écrire.\n\nCordialement,\nÉquipe STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_FOLLOWUP', 'it', 'Aggiornamento dopo l''ultima sessione',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">Com''è andata la sessione?</h2><p>Ciao <strong>{{partner_name}}</strong>,</p><p>Ti scriviamo per sapere com''è andata l''ultima sessione. Speriamo che i contenuti siano stati utili per il tuo lavoro quotidiano.</p><p>Se hai dubbi o vuoi approfondire qualche argomento, siamo qui per aiutarti.</p><p style="color:#666;font-size:.9em;">Cordiali saluti,<br>Team STC</p></div>',
 E'Ciao {{partner_name}},\n\nTi scriviamo per sapere com''è andata l''ultima sessione. Speriamo che i contenuti siano stati utili.\n\nSe hai dubbi o vuoi approfondire qualcosa, siamo qui.\n\nCordiali saluti,\nTeam STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_REMINDER', 'es', 'Recordatorio — próxima sesión STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">⏰ Próxima sesión</h2><p>Hola <strong>{{partner_name}}</strong>,</p><p>Te recordamos que tienes una sesión STC próximamente. Asegúrate de conectarte a tiempo y con la cámara activada.</p><p>Recibirás el enlace Zoom poco antes de la sesión. Si no puedes asistir, avísanos con antelación.</p><p style="color:#666;font-size:.9em;">Un saludo,<br>Equipo STC</p></div>',
 E'Hola {{partner_name}},\n\nTe recordamos que tienes una sesión STC próximamente. Conéctate a tiempo y con la cámara activada.\n\nRecibirás el enlace Zoom antes de la sesión. Si no puedes asistir, avísanos.\n\nUn saludo,\nEquipo STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_REMINDER', 'en', 'Reminder — upcoming STC session',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">⏰ Upcoming session</h2><p>Hi <strong>{{partner_name}}</strong>,</p><p>Just a reminder that you have an STC session coming up soon. Please make sure to connect on time and with your camera on.</p><p>You will receive the Zoom link shortly before the session. If you are unable to attend, please let us know in advance.</p><p style="color:#666;font-size:.9em;">Best regards,<br>STC Team</p></div>',
 E'Hi {{partner_name}},\n\nReminder: you have an STC session coming up soon. Please connect on time with your camera on.\n\nYou will receive the Zoom link before the session. If you cannot attend, please let us know.\n\nBest regards,\nSTC Team',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_REMINDER', 'fr', 'Rappel — prochaine séance STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">⏰ Prochaine séance</h2><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>Nous vous rappelons que vous avez une séance STC prochainement. Veillez à vous connecter à l''heure et avec votre caméra activée.</p><p>Vous recevrez le lien Zoom peu avant la séance. Si vous ne pouvez pas y assister, prévenez-nous à l''avance.</p><p style="color:#666;font-size:.9em;">Cordialement,<br>Équipe STC</p></div>',
 E'Bonjour {{partner_name}},\n\nRappel : vous avez une séance STC prochainement. Connectez-vous à l''heure avec votre caméra activée.\n\nVous recevrez le lien Zoom avant la séance. Si vous ne pouvez pas y assister, prévenez-nous.\n\nCordialement,\nÉquipe STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_REMINDER', 'it', 'Promemoria — prossima sessione STC',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#1a4a8a;">⏰ Prossima sessione</h2><p>Ciao <strong>{{partner_name}}</strong>,</p><p>Ti ricordiamo che hai una sessione STC in programma a breve. Assicurati di collegarti puntualmente e con la fotocamera attivata.</p><p>Riceverai il link Zoom poco prima della sessione. Se non puoi partecipare, avvisaci in anticipo.</p><p style="color:#666;font-size:.9em;">Cordiali saluti,<br>Team STC</p></div>',
 E'Ciao {{partner_name}},\n\nPromemoria: hai una sessione STC a breve. Collegati puntualmente con la fotocamera attiva.\n\nRiceverai il link Zoom prima della sessione. Se non puoi partecipare, avvisaci.\n\nCordiali saluti,\nTeam STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_CONGRATULATIONS', 'es', '¡Enhorabuena por tu progreso!',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#2c5f2e;">🎉 ¡Enhorabuena!</h2><p>Hola <strong>{{partner_name}}</strong>,</p><p>Quería felicitarte personalmente por tu progreso en el programa de formación STC. Tu dedicación y esfuerzo son un ejemplo para todo el equipo.</p><p>¡Sigue así, lo estás haciendo genial!</p><p style="color:#666;font-size:.9em;">Un abrazo,<br>Equipo STC</p></div>',
 E'Hola {{partner_name}},\n\nQuería felicitarte por tu progreso en el programa STC. Tu dedicación y esfuerzo son un ejemplo para todo el equipo.\n\n¡Sigue así, lo estás haciendo genial!\n\nUn abrazo,\nEquipo STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_CONGRATULATIONS', 'en', 'Congratulations on your progress!',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#2c5f2e;">🎉 Congratulations!</h2><p>Hi <strong>{{partner_name}}</strong>,</p><p>I wanted to personally congratulate you on your progress in the STC training programme. Your dedication and effort are an inspiration to the whole team.</p><p>Keep it up — you are doing great!</p><p style="color:#666;font-size:.9em;">Warm regards,<br>STC Team</p></div>',
 E'Hi {{partner_name}},\n\nI wanted to personally congratulate you on your progress in the STC programme. Your dedication is an inspiration to the whole team.\n\nKeep it up — you are doing great!\n\nWarm regards,\nSTC Team',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_CONGRATULATIONS', 'fr', 'Félicitations pour vos progrès !',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#2c5f2e;">🎉 Félicitations !</h2><p>Bonjour <strong>{{partner_name}}</strong>,</p><p>Je voulais vous féliciter personnellement pour vos progrès dans le programme de formation STC. Votre engagement et vos efforts sont une source d''inspiration pour toute l''équipe.</p><p>Continuez comme ça, vous faites un travail remarquable !</p><p style="color:#666;font-size:.9em;">Chaleureusement,<br>Équipe STC</p></div>',
 E'Bonjour {{partner_name}},\n\nJe voulais vous féliciter pour vos progrès dans le programme STC. Votre engagement est une source d''inspiration pour toute l''équipe.\n\nContinuez comme ça !\n\nChaleureusement,\nÉquipe STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;

INSERT INTO public.email_templates (template_key, language, subject, body_html, body_text, active) VALUES
('CONTACT_CONGRATULATIONS', 'it', 'Congratulazioni per i tuoi progressi!',
 '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;"><h2 style="color:#2c5f2e;">🎉 Congratulazioni!</h2><p>Ciao <strong>{{partner_name}}</strong>,</p><p>Volevo farti i miei complimenti personali per i progressi che stai facendo nel programma di formazione STC. La tua dedizione e il tuo impegno sono di ispirazione per tutto il team.</p><p>Continua così, stai facendo un lavoro straordinario!</p><p style="color:#666;font-size:.9em;">Un caro saluto,<br>Team STC</p></div>',
 E'Ciao {{partner_name}},\n\nVolevo farti i complimenti per i tuoi progressi nel programma STC. La tua dedizione è di ispirazione per tutto il team.\n\nContinua così, stai facendo un lavoro straordinario!\n\nUn caro saluto,\nTeam STC',
 true)
ON CONFLICT (template_key, language) DO NOTHING;
