Accessing Email Marketing
Navigate to Marketing > Mail in your admin panel to access the email campaign tool.The newsletter feature is called “Mail” in the OpenCart admin interface.
Creating an Email Campaign
Select Store
Choose which store to send from if you run a multi-store setup. This determines the sender email address and store name.
Choose Recipients
Select who should receive this email:
- Newsletter Subscribers: Customers who opted in to newsletters
- All Customers: Every customer in your database
- Specific Customers: Hand-pick individual customers
- Customer Group: Target a specific customer group (Wholesale, Retail, etc.)
- All Affiliates: All affiliate partners
- Specific Affiliates: Selected affiliate partners
- Product Purchasers: Customers who bought specific products
Write Email Content
Compose your email message:
- Subject Line: Enter an engaging subject (required)
- Message: Write your email body with HTML support
Recipient Types Explained
Newsletter Subscribers Only
Newsletter Subscribers Only
All Customers
All Customers
Sends to every customer account in your database, regardless of newsletter preference.Best for: Important account updates, security notifications, policy changesCaution: Use sparingly to avoid being marked as spam. Ensure emails are relevant to all customers.
Customer Group
Customer Group
Target specific customer groups like Wholesale, VIP, or Default customers.Best for: Group-specific promotions, tier-exclusive offers, B2B communicationsExample: Send wholesale pricing updates only to wholesale customers.
Specific Customers
Specific Customers
Manually select individual customers from a searchable list.Best for: Personalized offers, VIP communications, follow-up on specific issuesUse case: Send a special discount to customers who abandoned high-value carts.
Affiliate Partners
Affiliate Partners
Send to all or selected affiliate marketers.Best for: Affiliate program updates, new promotional materials, commission announcementsExample: “New products available - updated affiliate links inside!”
Product Purchasers
Product Purchasers
Target customers who previously purchased specific products.Best for: Cross-selling, upselling, product updates, complementary product offersExample: Send an email about camera accessories to everyone who bought a camera.Powerful for:
- Consumable product replenishment reminders
- Accessory recommendations
- Upgrade offers
- Product recall notifications
Email Content Best Practices
Subject Lines
Message Body
The message field supports HTML, allowing you to create rich, formatted emails:The email system automatically wraps your content in a proper HTML email template with your store branding.
Batch Processing
Email campaigns are sent in batches to prevent server overload and avoid being flagged as spam:- Batch Size: 200 emails per batch (configurable)
- Progress Tracking: System shows “Sent X of Y emails” during processing
- Queue System: Emails are queued via the task system for reliable delivery
Practical Email Campaign Examples
Example 1: New Product Announcement
To: Newsletter Subscribers Subject: “Just Arrived: The [Product Name] You’ve Been Waiting For”Example 2: Abandoned Cart Recovery
To: Specific Customers (with abandoned carts) Subject: “You left something behind… Plus 10% off to complete your order”Example 3: Customer Win-Back Campaign
To: Customers who haven’t purchased in 90+ days Subject: “We miss you! Here’s 20% off your next order”Example 4: Product Replenishment Reminder
To: Product Purchasers (consumable items bought 30+ days ago) Subject: “Time to restock your [Product Name]?”Example 5: Affiliate Update
To: All Affiliates Subject: “New Products + Increased Commissions for Q2”Email Deliverability Tips
Legal Compliance
Email marketing compliance:
- CAN-SPAM (USA): Include physical address, clear unsubscribe option
- GDPR (EU): Require explicit consent, honor unsubscribe requests within 30 days
- CASL (Canada): Get express consent before sending commercial emails
Technical Reference
Email Queue System
Emails are queued in the task system (oc_task table) for reliable background processing:
- Task Code:
mail_affiliateormail_customer - Action:
task/system/mail - Processing: Background cron job processes queued emails
- Status Tracking: Monitor in System > Tasks
Sender Configuration
Email sender details are pulled from store settings:- From Address:
config_emailfrom store settings - From Name:
config_name(store name) - Reply-To: Same as from address unless configured otherwise
Controller Methods
Key methods in/upload/admin/controller/marketing/contact.php:
index(): Display email campaign formsend(): Process and queue emails (line 67)- Recipient filtering logic (lines 135-235)
Database Tables
- Recipients: Pulled from
oc_customeroroc_customer_affiliate - Queue: Stored in
oc_tasktable - Newsletter Flag:
newsletterfield inoc_customer
Integration with CKEditor
The message field uses CKEditor for rich text formatting:- Visual HTML editor
- Format text (bold, italic, lists)
- Insert images and links
- HTML source editing
Troubleshooting
Emails not sending
Emails not sending
Check:
- SMTP settings in Settings > Store > Mail
- PHP mail() function is enabled on server
- Email addresses are valid
- Task queue is processing (check System > Tasks)
Emails going to spam
Emails going to spam
Causes:
- No SPF/DKIM records
- Spammy subject line or content
- High bounce rate
- Sending from shared hosting IP
- Set up proper DNS records
- Use a dedicated email sending service (SendGrid, Mailgun)
- Clean recipient list
- Avoid spam trigger words
Batch processing stopped
Batch processing stopped
Cause: Server timeout or error during batch processing.Solution: Check the task queue in System > Tasks. Delete failed tasks and try sending again with smaller batches.
Cannot select customers
Cannot select customers
Cause: JavaScript not loading or customer search autocomplete issue.Solution: Clear browser cache and ensure JavaScript is enabled. Check browser console for errors.
Advanced Strategies
Segmentation Strategy
-
Lifecycle Emails: Send different messages based on customer journey stage
- New customers: Welcome series
- Active customers: Loyalty rewards
- Inactive customers: Win-back campaigns
-
Purchase-Based Segmentation: Use product purchaser targeting
- Category-specific promotions
- Complementary product suggestions
- Replenishment reminders
-
Customer Group Targeting: Leverage customer groups
- Wholesale: Bulk discounts, new supplier terms
- Retail: Sales and promotions
- VIP: Exclusive early access
Campaign Calendar
Create a consistent email schedule:- Weekly: Newsletter subscribers (product highlights, blog posts)
- Monthly: All customers (major promotions, new arrivals)
- Quarterly: Affiliates (program updates, new materials)
- Triggered: Product purchasers (based on purchase behavior)

