Email: SendGrid & SMTP
Shadow Store supports email sending through SendGrid or SMTP for transactional emails, notifications, and customer communications. Choose the method that best fits your needs.
Overview
Email integration options:
- SendGrid: Cloud-based email service
- SMTP: Direct SMTP server connection (recommended)
- Google Workspace: Gmail/Google SMTP
SendGrid Integration
SendGrid is good because of its reliability, deliverability, and easy setup; however, it is a paid service.
Setting Up SendGrid
Step 1: Create SendGrid Account
- Visit SendGrid
- Sign up for an account
- Verify your email address
- Complete account setup
Step 2: Verify Sender Identity
For better deliverability:
- Navigate to Settings > Sender Authentication
- Choose single sender verification or domain authentication
- Follow verification steps
- Complete DNS setup (for domain authentication)
Step 3: Create API Key
- Go to Settings > API Keys
- Click "Create API Key"
- Name: "Shadow Store Production"
- Permissions: Select "Full Access" or "Mail Send" only
- Click "Create & View"
- Copy the API key immediately
API keys are only shown once. Save it securely immediately.
Configuring SendGrid in Shadow Store
Via Admin Panel:
- Navigate to Admin Panel > Integrations
- Scroll to SendGrid section
- Enter your SendGrid API Key
- Save configuration
Via Environment Variables:
Add to .env file:
SENDGRID_API_KEY=your_sendgrid_api_key_here
Testing SendGrid
- Send a test email from Shadow Store
- Check SendGrid Activity Feed for delivery
- Verify email arrives correctly
- Check spam folder if not in inbox
SMTP Integration
Use standard SMTP for self-hosted email or other providers.
SMTP Modes
Shadow Store supports two SMTP modes:
Basic SMTP:
- Standard SMTP connection
- Works with most email providers
- Simple configuration
Google Workspace (Gmail):
- Specialized for Google SMTP
- OAuth2 authentication
- Enhanced security
Basic SMTP Setup
Required Information:
- SMTP Host (e.g.,
smtp.example.com) - SMTP Port (e.g.,
587) - Username
- Password
- Encryption method (TLS/SSL)
Configuration:
Via Admin Panel:
- Navigate to Admin Panel > Integrations
- Select SMTP section
- Choose "Basic" mode
- Enter SMTP host
- Enter port number
- Enter username and password
- Select encryption method
- Save configuration
Via Environment Variables:
SMTP_HOST=smtp.example.com
SMTP_PORT=587
[email protected]
SMTP_PASS=your_password_here
Google Workspace SMTP
Use Gmail or Google Workspace for sending emails.
Prerequisites:
- Google Workspace account (or Gmail with App Password)
- Less secure app access enabled OR App Password generated
Step 1: Generate App Password (Recommended)
- Go to Google Account Security
- Enable 2-Step Verification (if not already)
- Navigate to App Passwords
- Generate new app password for "Mail"
- Copy the 16-character password
Step 2: Configure in Shadow Store
Via Admin Panel:
- Admin Panel > Integrations > SMTP
- Select "Google Workspace" mode
- Enter your Gmail address
- Enter the app password
- Save configuration
Via Environment Variables:
SMTP_HOST=null
SMTP_PORT=null
[email protected]
SMTP_PASS=your_app_password_here
Make sure to go to admin panel and set SMTP Mode.
Common SMTP Providers
Gmail/Google Workspace:
Host: smtp.gmail.com
Port: 587
Encryption: TLS
Outlook/Office 365:
Host: smtp.office365.com
Port: 587
Encryption: TLS
Yahoo Mail:
Host: smtp.mail.yahoo.com
Port: 587 or 465
Encryption: TLS or SSL
Custom Provider: Check your email provider's SMTP documentation for specific settings.
Email Types
Shadow Store sends various email types:
Transactional:
- Order confirmations
- Purchase receipts
- Account verifications
Marketing:
- Newsletters
Testing Email Configuration
Send Test Email
- Configure email integration
- Navigate to Admin Panel > Customers > Yourself
- Click "Send Email"
- Input a message
- Verify formatting and delivery
Troubleshooting Tests
Email not received:
- Check spam/junk folder
- Verify SMTP credentials
- Check server logs for errors
- Confirm email address is correct
Authentication failed:
- Verify username/password
- Check app password for Google
- Ensure less secure apps enabled (if needed)
- Try different port (587 vs 465)
Troubleshooting
SendGrid Issues
API Key Invalid:
- Verify API key is correct
- Check for extra spaces
- Ensure key has proper permissions
- Generate new key if needed
Emails Marked as Spam:
- Complete sender authentication
- Set up domain authentication
- Verify SPF/DKIM records
- Improve email content quality
- Check sender reputation
SMTP Issues
Connection Timeout:
- Verify SMTP host is correct
- Check port number
- Ensure firewall allows connection
- Try alternative port
Authentication Failed:
- Verify credentials are correct
- Check for app password requirement
- Ensure account isn't locked
- Verify encryption method matches
TLS/SSL Errors:
- Try alternative encryption method
- Update SSL certificates
- Check server SSL support
- Verify port matches encryption type
Switching Email Providers
To switch from one provider to another:
- Configure new provider credentials
- Test with test emails
- Monitor delivery for first batch
- Keep old provider active initially
- Fully switch after confirming new provider works
- Remove old credentials