diff --git a/.env.example b/.env.example index 79a42f4..8ed5894 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,16 @@ WREN_DRY_RUN=true # === Database Configuration === DATABASE_PATH=/app/data/orders.db +# === Email Configuration === +SMTP_HOST=mail.puffinoffset.com +SMTP_PORT=587 +SMTP_SECURE=false +SMTP_USER=noreply@puffinoffset.com +SMTP_PASSWORD=your_smtp_password_here +SMTP_FROM_NAME=Puffin Offset +SMTP_FROM_EMAIL=noreply@puffinoffset.com +ADMIN_EMAIL=matt@puffinoffset.com + # ======================================== # NOTES # ======================================== diff --git a/docker-compose.yml b/docker-compose.yml index cf5d616..eaff8a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,6 +45,7 @@ services: - SMTP_PASSWORD=${SMTP_PASSWORD} - SMTP_FROM_NAME=${SMTP_FROM_NAME} - SMTP_FROM_EMAIL=${SMTP_FROM_EMAIL} + - ADMIN_EMAIL=${ADMIN_EMAIL:-matt@puffinoffset.com} dns: - 8.8.8.8 - 8.8.4.4 diff --git a/server/utils/emailService.js b/server/utils/emailService.js index d0ea89c..c4d41d5 100644 --- a/server/utils/emailService.js +++ b/server/utils/emailService.js @@ -126,7 +126,7 @@ export async function sendReceiptEmail(customerEmail, orderDetails) { // Send contact form email export async function sendContactEmail(contactData) { const subject = `Contact Form: ${contactData.name}`; - const adminEmail = process.env.ADMIN_EMAIL || 'admin@puffinoffset.com'; + const adminEmail = process.env.ADMIN_EMAIL || 'matt@puffinoffset.com'; return await sendTemplateEmail( adminEmail, @@ -152,7 +152,7 @@ export async function sendContactEmail(contactData) { // Send admin notification for new order export async function sendAdminNotification(orderDetails, customerEmail) { const subject = `New Order: ${orderDetails.tons} tons CO₂ - $${(orderDetails.totalAmount / 100).toFixed(2)}`; - const adminEmail = process.env.ADMIN_EMAIL || 'admin@puffinoffset.com'; + const adminEmail = process.env.ADMIN_EMAIL || 'matt@puffinoffset.com'; // Check if admin notifications are enabled if (process.env.ADMIN_NOTIFY_ON_ORDER === 'false') {