Implement multi-language email templates
- Add language columns to email_templates table (subject_en/de, body_html_en/de, body_text_en/de) - Update adminEmail.js routes to support language-specific templates - Create EmailProcessor service to handle language selection based on recipient - Update EmailConfigPage component with language tabs similar to CMS pages - Add German translations for all email templates - Update all email queue usage to use proper template keys - Add missing email templates (gallery_expired, archive_complete) - Integrate email processor service into main server startup The system now automatically selects the appropriate language (English/German) based on the recipient's email domain or preferences. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -79,16 +79,14 @@ router.post('/', adminAuth, [
|
||||
});
|
||||
|
||||
// Queue creation email
|
||||
await db('email_queue').insert({
|
||||
event_id: eventId,
|
||||
recipient_email: host_email,
|
||||
email_type: 'creation',
|
||||
email_data: JSON.stringify({
|
||||
event_name,
|
||||
share_link: shareLink,
|
||||
password,
|
||||
expires_at
|
||||
})
|
||||
const { queueEmail } = require('../services/emailProcessor');
|
||||
await queueEmail(eventId, host_email, 'gallery_created', {
|
||||
host_name: host_email.split('@')[0], // Extract name from email
|
||||
event_name,
|
||||
event_date: new Date(event_date).toLocaleDateString(),
|
||||
gallery_link: shareLink,
|
||||
gallery_password: password,
|
||||
expiry_date: expires_at.toLocaleDateString()
|
||||
});
|
||||
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user