Technical Documentation: - docs/development/architecture-fixes-2026-01.md: Complete guide to all architecture validation fixes (62 -> 0 errors) User Guides: - docs/guides/email-templates.md: How-to guide for vendors and admins to use the email template customization system Implementation Docs: - docs/implementation/password-reset-implementation.md: Technical documentation for the password reset feature - Updated email-templates-architecture.md with EmailTemplateService documentation and related links Bugfix: - Fixed TemplateListItem Pydantic model to match service output (languages vs available_languages field name) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7.5 KiB
Email Templates Guide
Overview
The Wizamart platform provides a comprehensive email template system that allows:
- Platform Administrators: Manage all email templates across the platform
- Vendors: Customize customer-facing emails with their own branding
This guide covers how to use the email template system from both perspectives.
For Vendors
Accessing Email Templates
- Log in to your vendor dashboard
- Navigate to Settings > Email Templates in the sidebar
- You'll see a list of all customizable email templates
Understanding Template Status
Each template shows its customization status:
| Status | Description |
|---|---|
| Platform Default | Using the standard Wizamart template |
| Customized | You have created a custom version |
| Language badges (green) | Languages where you have customizations |
Customizing a Template
-
Click on any template to open the edit modal
-
Select the language tab you want to customize (EN, FR, DE, LB)
-
Edit the following fields:
- Subject: The email subject line
- HTML Body: The rich HTML content
- Plain Text Body: Fallback for email clients that don't support HTML
-
Click Save to save your customization
Template Variables
Templates use special variables that are automatically replaced with actual values. Common variables include:
| Variable | Description |
|---|---|
{{ customer_name }} |
Customer's first name |
{{ order_number }} |
Order reference number |
{{ vendor_name }} |
Your store name |
{{ platform_name }} |
Platform name (Wizamart or your whitelabel name) |
Each template shows its available variables in the reference panel.
Previewing Templates
Before saving, you can preview your template:
- Click Preview in the edit modal
- A preview window shows how the email will look
- Sample data is used for all variables
Testing Templates
To send a test email:
- Click Send Test Email in the edit modal
- Enter your email address
- Click Send
- Check your inbox to see the actual email
Reverting to Platform Default
If you want to remove your customization and use the platform default:
- Open the template edit modal
- Click Revert to Default
- Confirm the action
Your customization will be deleted and the platform template will be used.
Available Templates for Vendors
| Template | Category | Description |
|---|---|---|
| Welcome Email | AUTH | Sent when a customer registers |
| Password Reset | AUTH | Password reset link |
| Order Confirmation | ORDERS | Sent after order placement |
| Shipping Notification | ORDERS | Sent when order is shipped |
Note: Billing and subscription emails are platform-only and cannot be customized.
For Platform Administrators
Accessing Email Templates
- Log in to the admin dashboard
- Navigate to System > Email Templates in the sidebar
- You'll see all platform templates grouped by category
Template Categories
| Category | Description | Vendor Override |
|---|---|---|
| AUTH | Authentication emails | Allowed |
| ORDERS | Order-related emails | Allowed |
| BILLING | Subscription/payment emails | Not Allowed |
| SYSTEM | System notifications | Allowed |
| MARKETING | Promotional emails | Allowed |
Editing Platform Templates
- Click on any template to open the edit modal
- Select the language tab (EN, FR, DE, LB)
- Edit the subject and body content
- Click Save
Important: Changes to platform templates affect:
- All vendors who haven't customized the template
- New vendors automatically
Creating New Templates
To add a new template:
- Use the database seed script or migration
- Define the template code, category, and languages
- Set
is_platform_onlyif vendors shouldn't override it
Viewing Email Logs
To see email delivery history:
- Open a template
- Click View Logs
- See recent emails sent using this template
Logs show:
- Recipient email
- Send date/time
- Delivery status
- Vendor (if applicable)
Template Best Practices
- Use all 4 languages: Provide content in EN, FR, DE, and LB
- Test before publishing: Always send test emails
- Include plain text: Not all email clients support HTML
- Use consistent branding: Follow Wizamart brand guidelines
- Keep subjects short: Under 60 characters for mobile
Language Resolution
When sending an email, the system determines the language in this order:
- Customer's preferred language (if set in their profile)
- Vendor's storefront language (if customer doesn't have preference)
- Platform default (French - "fr")
Template Resolution for Vendors
- System checks if vendor has a custom override
- If yes, uses vendor's template
- If no, falls back to platform template
- If requested language unavailable, falls back to English
Branding
Standard Vendors
Standard vendors' emails include Wizamart branding:
- Wizamart logo in header
- "Powered by Wizamart" footer
Whitelabel Vendors
Enterprise-tier vendors with whitelabel enabled:
- No Wizamart branding
- Vendor's logo in header
- Custom footer (if configured)
Email Template Variables Reference
Authentication Templates
signup_welcome
{{ first_name }} - Customer's first name
{{ company_name }} - Vendor company name
{{ email }} - Customer's email
{{ login_url }} - Link to login page
{{ trial_days }} - Trial period length
{{ tier_name }} - Subscription tier
password_reset
{{ customer_name }} - Customer's name
{{ reset_link }} - Password reset URL
{{ expiry_hours }} - Link expiration time
Order Templates
order_confirmation
{{ customer_name }} - Customer's name
{{ order_number }} - Order reference
{{ order_total }} - Order total amount
{{ order_items_count }} - Number of items
{{ order_date }} - Order date
{{ shipping_address }} - Delivery address
Common Variables (All Templates)
{{ platform_name }} - "Wizamart" or whitelabel name
{{ platform_logo_url }} - Platform logo URL
{{ support_email }} - Support email address
{{ vendor_name }} - Vendor's business name
{{ vendor_logo_url }} - Vendor's logo URL
Troubleshooting
Email Not Received
- Check spam/junk folder
- Verify email address is correct
- Check email logs in admin dashboard
- Verify SMTP configuration
Template Not Applying
- Clear browser cache
- Verify the correct language is selected
- Check if vendor override exists
- Verify template is not platform-only
Variables Not Replaced
- Check variable spelling (case-sensitive)
- Ensure variable is available for this template
- Wrap variables in
{{ }}syntax - Check for typos in variable names
API Reference
For developers integrating with the email system:
Sending a Template Email
from app.services.email_service import EmailService
email_service = EmailService(db)
email_service.send_template(
template_code="order_confirmation",
to_email="customer@example.com",
to_name="John Doe",
language="fr",
variables={
"customer_name": "John",
"order_number": "ORD-12345",
"order_total": "99.99",
},
vendor_id=vendor.id,
related_type="order",
related_id=order.id,
)
See Email Templates Architecture for full technical documentation.