woutersf / email-rss-import-bundle
Import RSS feed items into Mautic email builder with customizable MJML templates
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 1
Language:JavaScript
Type:mautic-plugin
pkg:composer/woutersf/email-rss-import-bundle
Requires
- php: ^7.4|^8.0
- ext-simplexml: *
- mautic/core: ^4.0|^5.0
README
A powerful Mautic plugin that seamlessly integrates RSS feed content into your emails using the GrapesJS email builder. Import news articles, blog posts, or any RSS feed content directly into your email campaigns with a single click.
Features
- 🎯 GrapesJS Integration - Native block in the GrapesJS builder for easy content import
- 📰 RSS Feed Support - Import content from any RSS feed
- 🎨 Customizable Templates - Define your own MJML templates with token support
- ✅ Multi-Selection - Select multiple RSS items at once
- 🔧 Flexible Configuration - Configure RSS URL, fields, and templates per installation
- 🚀 No Core Modifications - Clean extension using Mautic's plugin system
Screenshots
1. GrapesJS Block
Find the RSS Feed block in your GrapesJS email builder's block panel:
2. Plugin Configuration
Configure your RSS feed settings in Mautic Settings → Plugins:
3. Content Selection
Select the RSS items you want to import into your email:
Installation
Option 1: Composer (Recommended)
-
Add the plugin to your Mautic installation:
composer require mautic/email-rss-import-bundle
-
Clear the Mautic cache:
php bin/console cache:clear
-
Navigate to Mautic Settings → Plugins
-
Click "Install/Upgrade Plugins"
-
Find "Email RSS Import" and click to configure it
Option 2: Manual Installation
-
Clone or download this repository into your Mautic plugins directory:
cd /path/to/mautic/plugins git clone <repository-url> MauticEmailRssImportBundle
-
Clear the Mautic cache:
php bin/console cache:clear
-
Navigate to Mautic Settings → Plugins
-
Click "Install/Upgrade Plugins"
-
Find "Email RSS Import" and click to configure it
Option 3: Private Repository
If you're hosting this plugin in a private repository, add it to your composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/your-username/mautic-email-rss-import-bundle.git"
}
],
"require": {
"mautic/email-rss-import-bundle": "^1.0"
}
}
Then run:
composer update mautic/email-rss-import-bundle php bin/console cache:clear
Configuration
Navigate to Settings → Plugins → Email RSS Import to configure:
RSS URL
Enter the URL of the RSS feed you want to import from.
Default: https://feeds.bbci.co.uk/news/rss.xml
RSS Fields
Define which fields to extract from the RSS feed (one per line).
Available fields:
title- The article titlelink- The article URLdescription- Article description/summarycategory- Article category/categoriespubDate- Publication datemedia- Featured image/media URL
HTML Template
Define the MJML template for each RSS item. Use tokens to insert RSS field values.
Available tokens: {title}, {link}, {description}, {category}, {pubDate}, {media}
Example template:
<mj-section background-color="#ffffff" padding-top="25px" padding-bottom="0"> <mj-column width="100%"> <mj-image src="{media}" alt="{title}" padding-top="0" padding-bottom="20px"></mj-image> <mj-text color="#000000" font-family="Ubuntu, Helvetica, Arial, sans-serif" font-size="20px" line-height="1.5" font-weight="500" padding-bottom="0px"> <p>{title}</p> </mj-text> <mj-text color="#000000" font-family="Ubuntu, Helvetica, Arial, sans-serif" font-size="16px" line-height="1.5" font-weight="300" align="justify"> <p>{description}</p> </mj-text> <mj-button background-color="#486AE2" color="#FFFFFF" href="{link}" font-family="Ubuntu, Helvetica, Arial, sans-serif" padding-top="20px" padding-bottom="40px">READ MORE</mj-button> <mj-text color="#666666" font-family="Ubuntu, Helvetica, Arial, sans-serif" font-size="12px"> <p>{category} - {pubDate}</p> </mj-text> </mj-column> </mj-section>
Usage
In GrapesJS Email Builder
-
Open the Email Builder
- Create a new email or edit an existing one
- Click "Builder" to launch GrapesJS
-
Find the RSS Feed Block
- Look in the left sidebar blocks panel
- Scroll to the "Extra" category
- Click on the "RSS Feed" block (orange RSS icon)
-
Select Content
- A modal will appear showing all available RSS items
- Use checkboxes to select the items you want to import
- Use "Select All" or "Deselect All" for bulk selection
- Click "Insert Selected Items"
-
Save Your Email
- The selected RSS items will be inserted into your email
- Each item will be formatted according to your template
- Items are inserted in chronological order from the feed
How It Works
- Extension System: The plugin registers itself with GrapesJS using Mautic's
window.MauticGrapesJsPluginsextension system - Block Registration: A custom block is added to the GrapesJS BlockManager
- RSS Fetching: When clicked, the plugin fetches RSS content from your configured feed via AJAX
- Token Replacement: Selected items are processed through the template with tokens replaced by actual values
- Content Insertion: The rendered MJML is inserted into the email canvas
Technical Details
Architecture
- Backend Controller:
RssController.php- Fetches and parses RSS feeds - Integration Class:
EmailRssImportIntegration.php- Handles plugin configuration - Frontend Extension:
grapesjs-rss-import.js- GrapesJS block and modal functionality - Event Subscriber:
AssetSubscriber.php- Injects JavaScript assets
Supported RSS Formats
- RSS 2.0
- Media RSS (for featured images)
- Multiple categories per item
Requirements
- Mautic 4.x or higher
- PHP 7.4 or higher
- GrapesJS Builder Plugin enabled
- SimpleXML PHP extension
Troubleshooting
RSS Feed Block Not Showing
- Ensure the plugin is Published in Settings → Plugins
- Ensure the "Active" setting is set to Yes in plugin configuration
- Clear Mautic cache:
php bin/console cache:clear - Check browser console for JavaScript errors
MJML Errors When Saving
- Ensure your template only contains valid MJML components
- Do not wrap the template in
<mjml>or<mj-body>tags (these are added automatically) - Ensure all text content is wrapped in
<mj-text>components - Validate your MJML at https://mjml.io/try-it-live
RSS Feed Not Loading
- Check that the RSS URL is accessible from your server
- Verify the RSS URL returns valid XML
- Check server logs for any PHP errors
- Ensure your server can make outbound HTTP requests
Development
File Structure
MauticEmailRssImportBundle/
├── Assets/
│ ├── css/
│ │ └── rss-import.css
│ ├── img/
│ │ └── rss-icon.png
│ └── js/
│ └── grapesjs-rss-import.js
├── Config/
│ └── config.php
├── Controller/
│ └── RssController.php
├── EventListener/
│ └── AssetSubscriber.php
├── Integration/
│ └── EmailRssImportIntegration.php
├── Resources/
│ └── views/
├── Translations/
│ └── en_US/
│ └── messages.ini
├── MauticEmailRssImportBundle.php
└── README.md
Extending the Plugin
To add custom RSS field parsing, modify RssController.php:
// Handle custom namespace $namespaces = $item->getNamespaces(true); if (isset($namespaces['custom'])) { $custom = $item->children($namespaces['custom']); $value = (string) $custom->customField; }
Author
Frederik Wouters
License
This plugin is provided as-is for use with Mautic installations.
Support
For issues, questions, or contributions, please open an issue in the repository.
Publishing to Packagist
To make this plugin available via Composer for everyone:
-
Push to GitHub (or GitLab/Bitbucket):
git init git add . git commit -m "Initial release v1.0.0" git tag v1.0.0 git remote add origin https://github.com/your-username/mautic-email-rss-import-bundle.git git push -u origin main git push --tags
-
Submit to Packagist:
- Go to https://packagist.org
- Sign in with your GitHub account
- Click "Submit"
- Enter your repository URL:
https://github.com/your-username/mautic-email-rss-import-bundle - Packagist will automatically track new releases via your Git tags
-
Auto-Update Hook (Optional):
- In your GitHub repository settings, add Packagist webhook for automatic updates
- Settings → Webhooks → Add webhook
- Payload URL:
https://packagist.org/api/github?username=YOUR_USERNAME
Version Tagging
When releasing new versions:
# Update composer.json version if needed git add . git commit -m "Release v1.1.0" git tag v1.1.0 git push && git push --tags
Packagist will automatically detect the new tag and update the package.
Changelog
Version 1.0.0
- Initial release
- GrapesJS block integration
- RSS feed parsing with configurable fields
- MJML template support with token replacement
- Multi-item selection
- Configuration interface
- Drag-and-drop block functionality
- Composer support


