Checkpoint: Ajout de l'interface de configuration SMTP avec Resend : formulaire de configuration (API key, email expéditeur, nom), basculement simulation/production, test d'envoi immédiat, stockage sécurisé en base de données, et guide de configuration intégré
This commit is contained in:
@@ -171,3 +171,30 @@ export const emailTemplates = mysqlTable("emailTemplates", {
|
||||
|
||||
export type EmailTemplate = typeof emailTemplates.$inferSelect;
|
||||
export type InsertEmailTemplate = typeof emailTemplates.$inferInsert;
|
||||
|
||||
/**
|
||||
* Table de configuration SMTP/Email
|
||||
* Stocke la configuration pour l'envoi d'emails (Resend, etc.)
|
||||
*/
|
||||
export const emailConfig = mysqlTable("emailConfig", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
/** Service d'envoi (resend, smtp) */
|
||||
provider: varchar("provider", { length: 50 }).default("resend").notNull(),
|
||||
/** Clé API Resend (chiffrée) */
|
||||
apiKey: text("apiKey"),
|
||||
/** Email expéditeur */
|
||||
fromEmail: varchar("fromEmail", { length: 320 }).notNull(),
|
||||
/** Nom de l'expéditeur */
|
||||
fromName: varchar("fromName", { length: 255 }).default("Formation Manager Itinova").notNull(),
|
||||
/** Mode: simulation ou production */
|
||||
mode: mysqlEnum("mode", ["simulation", "production"]).default("simulation").notNull(),
|
||||
/** Domaine vérifié (pour Resend) */
|
||||
domainVerified: boolean("domainVerified").default(false).notNull(),
|
||||
/** Actif ou non */
|
||||
active: boolean("active").default(true).notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
|
||||
});
|
||||
|
||||
export type EmailConfig = typeof emailConfig.$inferSelect;
|
||||
export type InsertEmailConfig = typeof emailConfig.$inferInsert;
|
||||
|
||||
Reference in New Issue
Block a user