Checkpoint: Ajout d'un template d'email personnalisable pour l'envoi des attestations de formation. Le template utilise des variables dynamiques ({{prenomApprenant}}, {{nomApprenant}}, {{nomFormation}}) et peut être modifié depuis l'interface de gestion des templates. Déployé sur le VPS avec migration SQL.

This commit is contained in:
Manus
2026-01-29 11:58:20 -05:00
parent a221deb4f1
commit 493366fa10
12 changed files with 6931 additions and 20 deletions

View File

@@ -0,0 +1,37 @@
{
"query": "SELECT type FROM emailTemplates;",
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT type FROM emailTemplates;",
"rows": [
{
"type": "inscription"
},
{
"type": "teaser"
},
{
"type": "rappel"
},
{
"type": "rappelJ1"
},
{
"type": "rappel3"
},
{
"type": "rappel4"
},
{
"type": "rappel5"
},
{
"type": "rappel6"
},
{
"type": "reset_password"
}
],
"messages": [],
"stdout": "type\ninscription\nteaser\nrappel\nrappelJ1\nrappel3\nrappel4\nrappel5\nrappel6\nreset_password\n",
"stderr": "",
"execution_time_ms": 51
}

View File

@@ -0,0 +1,9 @@
{
"query": "ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel','rappelJ1','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel','rappelJ1','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"rows": [],
"messages": [],
"stdout": "",
"stderr": "",
"execution_time_ms": 536
}

View File

@@ -0,0 +1,9 @@
{
"query": "INSERT INTO emailTemplates (type, titre, bodyContent, couleurPrincipale, couleurSecondaire, piedDePage) \nVALUES (\n 'attestation',\n 'Votre attestation de formation',\n '<h2>Votre attestation de formation</h2>\\n\\n<p>Bonjour {{prenomApprenant}} {{nomApprenant}},</p>\\n\\n<p>Nous avons le plaisir de vous transmettre votre attestation de formation pour :</p>\\n\\n<div class=\"info-box\" style=\"background-color: #dbeafe; border-left-color: #3b82f6;\">\\n <h3>{{nomFormation}}</h3>\\n</div>\\n\\n<p>Vous trouverez votre attestation en pièce jointe de cet email.</p>\\n\\n<p>Cette attestation certifie votre participation à la formation et peut être utilisée pour votre dossier professionnel.</p>\\n\\n<p>Nous vous remercions pour votre participation et vous souhaitons une excellente continuation.</p>\\n\\n<p>Cordialement,<br/>L''équipe Formation</p>',\n '#283581',\n '#0578BE',\n NULL\n);",
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute INSERT INTO emailTemplates (type, titre, bodyContent, couleurPrincipale, couleurSecondaire, piedDePage) \nVALUES (\n 'attestation',\n 'Votre attestation de formation',\n '<h2>Votre attestation de formation</h2>\\n\\n<p>Bonjour {{prenomApprenant}} {{nomApprenant}},</p>\\n\\n<p>Nous avons le plaisir de vous transmettre votre attestation de formation pour :</p>\\n\\n<div class=\"info-box\" style=\"background-color: #dbeafe; border-left-color: #3b82f6;\">\\n <h3>{{nomFormation}}</h3>\\n</div>\\n\\n<p>Vous trouverez votre attestation en pièce jointe de cet email.</p>\\n\\n<p>Cette attestation certifie votre participation à la formation et peut être utilisée pour votre dossier professionnel.</p>\\n\\n<p>Nous vous remercions pour votre participation et vous souhaitons une excellente continuation.</p>\\n\\n<p>Cordialement,<br/>L''équipe Formation</p>',\n '#283581',\n '#0578BE',\n NULL\n);",
"rows": [],
"messages": [],
"stdout": "",
"stderr": "",
"execution_time_ms": 66
}

View File

@@ -0,0 +1,8 @@
{
"query": "ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"returncode": 1,
"logs": [
"ERROR 1265 (01000) at line 1: Data truncated for column 'type', value is 'rappel'"
]
}

View File

@@ -0,0 +1,8 @@
{
"query": "ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute ALTER TABLE `emailTemplates` MODIFY COLUMN `type` enum('inscription','teaser','rappel','rappel1','rappel2','rappel3','rappel4','rappel5','rappel6','reset_password','attestation') NOT NULL;",
"returncode": 1,
"logs": [
"ERROR 1265 (01000) at line 1: Data truncated for column 'type', value is 'rappelJ1'"
]
}