Remove EMAIL_RECIPIENTS environment variable and update email notification logic
This commit is contained in:
@@ -325,18 +325,14 @@ app.post('/api/events/:slug/rsvp', async (req: Request, res: Response) => {
|
|||||||
// Get recipients from event settings
|
// Get recipients from event settings
|
||||||
let recipients: string[] = [];
|
let recipients: string[] = [];
|
||||||
|
|
||||||
// First try to use the event's email recipients
|
// Use the event's email recipients
|
||||||
if (eventEmailRecipients) {
|
if (eventEmailRecipients) {
|
||||||
recipients = eventEmailRecipients.split(',').map(addr => addr.trim()).filter(Boolean);
|
recipients = eventEmailRecipients.split(',').map(addr => addr.trim()).filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no event recipients, fall back to environment variables
|
// If no recipients are set for the event, use the sender email as a fallback
|
||||||
if (recipients.length === 0) {
|
if (recipients.length === 0 && process.env.EMAIL_USER) {
|
||||||
if (process.env.EMAIL_RECIPIENTS) {
|
recipients = [process.env.EMAIL_USER];
|
||||||
recipients = process.env.EMAIL_RECIPIENTS.split(',').map(addr => addr.trim()).filter(Boolean);
|
|
||||||
} else if (process.env.EMAIL_USER) {
|
|
||||||
recipients = [process.env.EMAIL_USER];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipients.length > 0) {
|
if (recipients.length > 0) {
|
||||||
|
|||||||
@@ -17,11 +17,10 @@ services:
|
|||||||
- EMAIL_PASS=yourpassword
|
- EMAIL_PASS=yourpassword
|
||||||
- EMAIL_FROM_NAME=RSVP Manager
|
- EMAIL_FROM_NAME=RSVP Manager
|
||||||
- EMAIL_FROM_ADDRESS=your@email.com
|
- EMAIL_FROM_ADDRESS=your@email.com
|
||||||
- EMAIL_RECIPIENTS=admin1@email.com,admin2@email.com
|
|
||||||
- EMAIL_SECURE=false
|
- EMAIL_SECURE=false
|
||||||
- FRONTEND_BASE_URL=https://your-frontend-domain.com
|
- FRONTEND_BASE_URL=https://your-frontend-domain.com
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
uploads:
|
uploads:
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ services:
|
|||||||
- EMAIL_FROM_NAME=RSVP Manager
|
- EMAIL_FROM_NAME=RSVP Manager
|
||||||
- EMAIL_FROM_ADDRESS=your@email.com
|
- EMAIL_FROM_ADDRESS=your@email.com
|
||||||
- EMAIL_SECURE=false
|
- EMAIL_SECURE=false
|
||||||
- EMAIL_RECIPIENTS=admin1@email.com,admin2@email.com
|
|
||||||
- FRONTEND_BASE_URL=https://your-frontend-domain.com
|
- FRONTEND_BASE_URL=https://your-frontend-domain.com
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
uploads:
|
uploads:
|
||||||
|
|||||||
Reference in New Issue
Block a user