feat: add email notification for new leave requests

- mailer.ts: nodemailer transport via local sendmail
- leave-notification.ts: HTML email matching PHP template
- Sends notification to LEAVE_NOTIFY_EMAIL on new leave request
- Non-blocking: errors logged but don't fail the request
- Added LEAVE_NOTIFY_EMAIL and APP_URL env vars

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-23 11:54:29 +01:00
parent 0baa604ade
commit 8a453deaac
5 changed files with 145 additions and 0 deletions

View File

@@ -37,8 +37,11 @@ export const config = {
contactTo: process.env.CONTACT_EMAIL_TO || '',
contactFrom: process.env.CONTACT_EMAIL_FROM || '',
smtpFrom: process.env.SMTP_FROM || '',
leaveNotify: process.env.LEAVE_NOTIFY_EMAIL || '',
},
appUrl: process.env.APP_URL || '',
cors: {
origins: (process.env.CORS_ORIGINS || '').split(',').filter(Boolean),
},