This guide covers configuring email notifications using Resend for order confirmations and contact form submissions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aluxey/E-Commerce/llms.txt
Use this file to discover all available pages before exploring further.
Why Resend?
The application uses Resend for transactional emails because:- Simple API with excellent developer experience
- Generous free tier (100 emails/day, 3,000/month)
- Custom domain support
- React Email component support
- Detailed delivery analytics
Create Resend Account
Sign Up
- Go to resend.com
- Click Start Building
- Sign up with GitHub or email
- Verify your email address
Configure Email Domain (Optional)
For production, use a custom domain for better deliverability.Add Domain
- In Resend dashboard, go to Domains
- Click Add Domain
- Enter your domain (e.g.,
sabbelshandmade.com) - Click Add
Configure DNS Records
Resend provides DNS records to add:
- Add the provided SPF, DKIM, and DMARC records to your DNS
- Wait for DNS propagation (up to 48 hours, usually faster)
- Click Verify DNS Records in Resend dashboard
Until verified, you can use
onboarding@resend.dev as the sender address for testing.Email Types
The application sends two types of emails:1. Order Confirmation
Sent when a payment succeeds. Trigger: Stripe webhookpayment_intent.succeeded
Recipient: Shop owner (sabbelshandmade@gmail.com)
Contains:
- Order number and date
- Customer name and email
- Ordered items with sizes, colors, quantities
- Total amount
- Payment status
/api/src/server.js:289-428
Template preview:
2. Contact Form
Sent when a customer submits the contact form. Trigger: POST to/api/contact
Recipient: Shop owner (sabbelshandmade@gmail.com)
Contains:
- Customer name and email (with Reply-To)
- Subject line
- Message content
- Optional file attachment (up to 10MB)
- Timestamp
/api/src/server.js:434-535
Email Configuration
Set these environment variables:API Server (.env)
/api/src/server.js:16-17
To change the recipient email, update the
EMAIL_TO constant in /api/src/server.js.Email Features
HTML Styling
Emails use inline CSS for compatibility:- Gradient header with brand colors
- Responsive table layout
- Clean typography
- Proper spacing and padding
Order Email Details
The order confirmation email fetches:- Order information from
orderstable - Customer details from
userstable - Order items with product names from
itemstable - Variant details (size, color) from
item_variantsandcolorstables
/api/src/server.js:292-322
Contact Form Features
File attachments supported:- Maximum size: 10MB
- All file types allowed
- Attachment name and size shown in email
/api/src/server.js:514-520
/api/src/server.js:509
Testing Emails
Without Resend (Development)
IfRESEND_API_KEY is not set:
- Emails are logged to console instead of sending
- Contact form returns success response
- No actual emails sent
/api/src/server.js:422-425
With Resend (Production)
Test Order Email
- Create a test order in your application
- Complete payment with test card:
4242 4242 4242 4242 - Check Resend dashboard Logs for delivery status
- Verify email arrived at recipient inbox
Test Contact Form
- Navigate to contact page
- Fill out form with test data
- Optionally attach a file
- Submit form
- Check email inbox and Resend logs
Customizing Email Templates
To modify email templates, edit the HTML in: Order confirmation:/api/src/server.js:351-412
Contact form: /api/src/server.js:450-504
Tips for Email HTML
- Use inline styles - Email clients don’t support
<style>tags well - Use tables for layout - Flexbox/Grid not supported in many clients
- Test in multiple clients - Gmail, Outlook, Apple Mail render differently
- Keep it simple - Complex CSS often breaks
- Use web fonts carefully - Many clients fall back to system fonts
Brand Colors
Current brand gradient:Production Checklist
Before going live:- Add and verify custom domain in Resend
- Update sender address from
onboarding@resend.devto your domain - Set
RESEND_API_KEYin production environment - Test order confirmation email with live payment
- Test contact form with attachment
- Configure SPF/DKIM/DMARC DNS records
- Monitor email deliverability in Resend dashboard
- Set up email forwarding/alias for recipient address
Next Steps
Troubleshooting
Emails Not Sending
Check console logs:- Check
RESEND_API_KEYis set in environment - Ensure key starts with
re_ - Verify key has send permissions
Emails Going to Spam
Solutions:- Verify custom domain with SPF/DKIM records
- Don’t use
onboarding@resend.devin production - Ensure “From” address matches verified domain
- Ask recipients to whitelist your sender address
- Check Resend deliverability score
HTML Rendering Issues
Common problems:- Styles not applied → Use inline styles, not
<style>tags - Layout broken → Use tables instead of divs for structure
- Images not loading → Use absolute URLs, not relative paths
- Fonts not working → Provide fallback system fonts
- Litmus - Test across email clients
- Email on Acid - Email testing platform
- Send test emails to yourself in Gmail, Outlook, Apple Mail
Attachment Too Large
Maximum attachment size: 10MB Code reference:/api/src/server.js:30-33
- Update
limits.fileSizein server.js - Verify Resend supports larger attachments
- Consider using file hosting instead for very large files