-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Summary
Add support for manually providing text versions of HTML emails in the email plugin. This would allow emails to be properly displayed in mail clients that don't support HTML rendering.
Background
This feature request is based on discussion in PR #3609 and the original issue #1366.
Related comment: #3609 (comment)
Proposed Solution
Add a new builder method (e.g., .setTextFallback()) to email event handlers that allows users to manually specify a text version of their HTML emails.
Example usage:
emailPlugin.setHandler('order-confirmation', new EmailEventHandler({
// ... existing config
setTextFallback: (event) => {
return `Order Confirmation\n\nOrder #${event.order.code}\n...`;
}
}))Requirements
- User control: Users should be able to manually provide their own text versions
- Opt-out capability: Feature should be optional
- Flexibility: Support text versions that differ from HTML (e.g., more concise text for complex layouts)
- Proper URL handling: Text versions should properly include URLs that may be embedded in HTML links
- Minimal dependencies: Avoid heavy external libraries
Benefits
- Better email client compatibility
- Improved deliverability and spam scores
- Better accessibility for users with text-only email clients
- User control over the exact text content