Overview
The HTML element allows you to include raw HTML content in your notifications. This gives you complete control over the HTML structure and styling when standard Elemental elements don’t meet your needs. When to use:- Custom HTML structures (tables, complex layouts)
- HTML that requires specific formatting not available in Elemental elements
- Legacy HTML content that needs to be preserved
- Custom styling that requires direct HTML/CSS
Basic Example
Fields
The type of element. For HTML elements, this value must be
"html".The raw HTML content to be included in the notification. This can include any valid HTML markup, including CSS styles.
Region-specific content for localization. See the Locales documentation for more details.
An array of channel names. The HTML element will only be rendered for the specified channels. See Control Flow documentation for details.
Examples & Variants
Simple HTML
Basic HTML content:HTML Table
Create custom HTML tables:HTML with Handlebars
Use Handlebars variables in HTML:HTML with Localization
Localize HTML content:Channel-Specific HTML
Only render HTML for email:Best Practices
- Use sparingly: Prefer standard Elemental elements when possible for better cross-channel compatibility
- Email only: Remember that HTML elements only work in email channels
- Test thoroughly: HTML rendering can vary across email clients; test in multiple clients
- Use inline styles: Email clients often strip
<style>tags, so use inline CSS - Keep it simple: Complex HTML may not render correctly in all email clients
Channel Support
- Email: ✅ Full support
- Push: ❌ Not supported
- SMS: ❌ Not supported
- Inbox: ❌ Not supported
Related Elements
- Text Element - For text content (cross-channel compatible)
- Image Element - For images
- Channel Element - For channel-specific content customization
- Control Flow - For conditional rendering