Download the PHP package linderp/sulu-mailing-list-bundle without Composer
On this page you can find all versions of the php package linderp/sulu-mailing-list-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download linderp/sulu-mailing-list-bundle
More information about linderp/sulu-mailing-list-bundle
Files in linderp/sulu-mailing-list-bundle
Package sulu-mailing-list-bundle
Short Description Mailing List Bundle for Sulu CMS
License MIT
Informations about the package sulu-mailing-list-bundle
SuluMailingListBundle
Sulu bundle to manage mailing lists, subscribe contacts (including via Sulu Forms), and send MJML-based newsletter mails from the admin UI.
Features
- Newsletter management with translatable content and double-opt-in templates.
- Newsletter subscriptions with confirm/unsubscribe flow and locale-aware subscriptions.
- Admin UI resources and lists for newsletters, newsletter mails, and subscriptions.
- Newsletter mails can target newsletter subscribers and optionally filter by selected contacts.
- MJML + Twig email templates with configurable wrappers/components and optional caching.
- Optional form integration via
linderp/sulu-form-save-contact-bundleto auto-subscribe contacts.
Requirements
- PHP 8.2+
- Sulu 3.0.8 or newer in the 3.0 release line
linderp/sulu-form-save-contact-bundlelinderp/sulu-base-bundle
Installation
-
Install the bundle:
-
If you are not using Symfony Flex, add the bundle to
config/bundles.php: - Register routes:
config/routes_admin.yaml
config/routes_website.yaml
-
Configure MJML and sender settings in
config/packages/sulu_mailing_list.yaml: - Add the admin UI assets dependency (admin app):
assets/admin/package.json
- Import the admin UI bundle:
assets/admin/app.js
- Build admin assets:
Admin UI
The bundle registers admin resources and lists for:
newslettersnewsletters_mailsnewsletters_subscriptionsfiltered_contacts(used by the newsletter mail contact selector)
Toolbar actions are provided for:
- Subscribe / Unsubscribe on newsletter subscription lists.
- Send on newsletter mail detail view (disabled if already sent or translations are missing).
Website routes (unsubscribe / confirm)
The website routes are handled by NewsletterWebsiteController:
/{locale}/newsletter/unsubscribe/{newsletterId}/{token}/{locale}/newsletter/confirm/{newsletterId}/{token}
Both routes redirect to the configured unsubscribe/confirmation pages on the newsletter entity.
Sending newsletters
- Mails are sent only once (
sent = trueafter send). - Only confirmed and not-unsubscribed subscriptions are included.
- If contacts are selected, subscribers are filtered to those contacts.
- Duplicates are removed per contact.
Sulu Forms integration
The bundle provides two dynamic field types:
newsletter(checkbox)hidden_newsletter
When a form submission is saved via linderp/sulu-form-save-contact-bundle, selected newsletters are attached to the saved contact and handled by the subscription service.
Email templates
MJML + Twig templates live in Resources/views/mails/:
base_email.mjml.twig(base layout)wrappers/for layout sectionscomponents/for individual blocks
Templates are rendered through the MJML API and can be cached via sulu_mailing_list.mjml.caching.
Extending mail editor resources
The mail editor is built from four building blocks: resources, wrappers, contexts, and fields.
When you add one, you must wire it in the correct places. The exact locations differ per type.
Where things live:
- Resources: form XML in
Resources/config/forms/*.xml+ type class inMail/Resource/Types/ - Wrappers: XML in
Resources/config/mail/wrappers/*.xml+ MJML inResources/views/mails/wrappers/+ type class inMail/Wrapper/Types/ - Contexts: XML in
Resources/config/mail/contexts/*.xml+ type class inMail/Context/Types/(no MJML template) - Fields: XML in
Resources/config/mail/types/*.xml+ MJML inResources/views/mails/components/<type>/<type>.mjml.twig+ type class inMail/Field/Types/
Notes:
- Keep XML names/keys aligned with the PHP type name and Twig template name.
- Update translations in
Resources/translations/if you add new labels. - PHP types are auto-registered via
#[AutoconfigureTag(...)]on the corresponding interface (no manual pool registration needed).
Example: add a new field type quote
-
XML:
Resources/config/mail/types/quote.xml -
MJML:
Resources/views/mails/components/quote/quote.mjml.twig - PHP type:
Mail/Field/Types/QuoteMailFieldType.php
Admin icon PNG generation
The bundle includes a helper script to generate PNGs from Font Awesome solid SVGs, with optional color variants.
Script location:
vendor/linderp/sulu-mailing-list-bundle/scripts/generate-fontawesome-pngs.js
Default output folder:
icons/ (in the project root, when run from the project root)
Default Font Awesome SVG folder:
assets/admin/node_modules/@fortawesome/fontawesome-free/svgs/solid
Additional SVG folder included:
vendor/linderp/sulu-mailing-list-bundle/Resources/social (e.g. social brand icons)
Examples (run from the project root):
Notes:
- The script reads solid SVGs from
assets/admin/node_modules/@fortawesome/fontawesome-free/svgs/solidby default, but you can override with--svg-dir. - It also includes SVGs from
Resources/social/(e.g.facebook.svg,facebook-noshare.svg). - It skips PNGs that already exist, so you can rerun it to resume.
- PNGs are named
{svg-name}.pngand{svg-name}-{color}.png.
Additional Setup
Fonts
To add a font for the admin mail editor, create a class implementing MailFontInterface:
To render a selected font as a PNG for clients with limited webfont support, enable it explicitly. The font file referenced by the CSS URL is rasterized by the server-side Imagick extension, and the image is written below the configured public path:
The optional stroke width is measured in output pixels and is configured per
font. It defaults to 0, so a webfont only receives a background-colored text
outline when setStrokeWidth() is enabled. The outline is centered on the
glyph edge. The default background color used for inherit or missing
backgrounds can be configured with mjml.default_background_color and
defaults to #FFFFFF.
This should be reserved for short decorative text. Live text remains the default because it is accessible and remains available when images are blocked.
Provide the CSS and referenced font files locally below public. The renderer
does not fetch remote CSS or font files during mail rendering. Example CSS:
All versions of sulu-mailing-list-bundle with dependencies
ext-curl Version *
qferr/mjml-php Version ^2.0
sulu/sulu Version ^3.0.8
linderp/sulu-form-save-contact-bundle Version ^0.2 || dev-main
linderp/sulu-base-bundle Version ^0.2 || dev-main
symfony/config Version ^6.4 | ^7.1
symfony/dependency-injection Version ^6.2 | ^7.0
symfony/framework-bundle Version ^6.2 | ^7.0
symfony/http-foundation Version ^6.2 | ^7.0
symfony/http-kernel Version ^6.2 | ^7.0
symfony/intl Version ^6.2 | ^7.0
symfony/translation Version ^6.2 | ^7.0
symfony/security-core Version ^6.4 | ^7.1