A Mautic plugin that connects the GrapesJS editor to CiviCRM.
Designed for current Mautic versions, Mautic 7, and tested with CiviCRM 6.15.
A neutral starter theme is bundled here:
Resources/theme-prototype/proto_mjml
Its goal is to provide a copy-ready base for themes/ with:
- a clean Mautic/MJML theme structure
- a
theme_variables.json - a few generic GrapesJS blocks
- no business-specific branding
Example local install:
cp -R CiviCrmBuilderBundle/Resources/theme-prototype/proto_mjml /path/to/mautic/themes/proto_mjmlYou can then rename the folder, replace the colors, extend blocks/, and add your own assets.
- Copy the plugin into Mautic's
plugins/directory. - Clear the Mautic cache.
- Reload plugins.
- Publish and enable
CiviCrmBuilderBundle.
Example cache flush:
php bin/console cache:clearA plugin reload command commonly used depending on the Mautic version is:
php bin/console mautic:plugins:reloadIf that command is not available on your instance, reload plugins from the Mautic UI.
If your instance uses another entrypoint or another system user, adapt the command to your hosting setup.
In Mautic:
- Open
Settings>Plugins. - Open
CiviCRM Builder. - Fill in
CiviCRM URL. - Fill in the
API key (Bearer token). - Save.
Expected values:
CiviCRM URL: the root URL of your instance, for examplehttps://crm.example.orgAPI key (Bearer token): the API key expected by theX-Civi-Auth: Bearer ...header (Must be enabled in CiviCRM: Administer > System Settings > Authentication)
The form validates the connection to CiviCRM on save.
In practice, clear the Mautic cache:
- after adding or updating the plugin
- after adding a new theme in
themes/ - after changing Twig templates if Mautic does not reload views correctly
Common command:
php bin/console cache:clearproto_mjml/
├── assets/
│ ├── fonts/
│ └── img/
├── blocks/
│ ├── proto-button.json
│ ├── proto-domain-civicrm.json
│ ├── proto-divider.json
│ ├── proto-footer.json
│ ├── proto-greeting-civicrm.json
│ ├── proto-header.json
│ ├── proto-links-civicrm.json
│ ├── proto-section.json
│ ├── proto-text.json
│ ├── proto-title.json
│ ├── proto-unsubscribe.json
│ └── proto-webview.json
├── config.json
├── css/
│ └── proto.css
├── html/
│ ├── base.html.twig
│ ├── email.mjml.twig
│ ├── form.html.twig
│ ├── message.html.twig
│ ├── page.html.twig
│ └── MauticFormBundle/
│ └── Builder/
├── theme_variables.json
└── thumbnail.png (optional)
config.jsondeclares the theme and its Mautic features.theme_variables.jsonprovides the dynamic variables replaced inside blocks.html/email.mjml.twigis the base for newsletters/emails.blocks/contains the custom blocks loaded by the bundle.- some bundled blocks demonstrate CiviCRM tokens such as
{$contact.first_name},{mailing.viewUrl},{action.optOutUrl},{domain.name}, and{domain.email}. assets/is free-form: images, fonts, icons, and so on.
npm install
npm run buildnpm run start