Newsletter Management: Configuration
Newsletter Management for Sylius: per-channel settings, categories, admin lists, CSV export, sender, privacy policy link, mailer transport and practical examples
Newsletter Management: Configuration
This documentation always describes the latest published version.
Everything that controls how the newsletter behaves in your shop is managed in the admin, per channel. Only the button colors used in the plugin's emails live in a configuration file. This page covers the settings, the newsletter categories, the admin lists and the CSV export of subscribers.
Overview: where to find what
The plugin adds exactly one entry to the admin sidebar: MMKreativ Plugins → Newsletter management. It opens the list of newsletter settings. Everything else is reached through buttons in the title bar of that page, and each of those pages has a button in its own title bar that takes you back.
| Title-bar button | Destination |
|---|---|
| Newsletters | List of newsletters: write, send, schedule (see Writing and sending newsletters) |
| Statistics | Dashboard with subscriber numbers and trend (see Tracking and statistics) |
| Subscribers | List of all signups with CSV export |
| Categories | List of newsletter categories |
The categories are also listed right below the settings list, with a button to create one. Without a category the signup form offers no choice.
As long as a channel has no settings or "Newsletter enabled" is off, that channel behaves as if the plugin were not installed: the
/newsletterpage returns 404, the footer form is missing, and Sylius' own newsletter checkbox is left alone. Unsubscribe and manage links in emails that have already been sent keep working.
Settings per channel
These settings are not bundle configuration but database records. There is at most one record per channel. Create it with "Create" on the newsletter settings list and pick the channel there.
| Setting (admin label) | Default | Description |
|---|---|---|
| Newsletter enabled | off | Master switch. While it is off, the channel shows no signup form and accepts no signups. |
| Double opt-in | on | A signup only counts once the customer has followed the link in the confirmation email. Without double opt-in a signup is confirmed immediately. Generally required in the EU. |
| Signup form in the footer | on | Shows a compact form (email address and button) in the shop footer that hands over to the signup page. |
| Privacy policy page | empty | Target of the link on the consent checkbox (see Privacy policy link). Empty = no link. At most 255 characters. |
| Keep unsubscribed subscriptions for (days) | 1095 | Range 30 to 3650. After that, mmd:newsletter:subscription:purge deletes unsubscribed signups permanently. |
| Keep unconfirmed signups for (days) | 30 | Range 7 to 365. After that, the same command deletes signups whose confirmation link was never clicked. Only relevant with double opt-in. |
| Tracking | Off | Off, Anonymous (counters only) or Personal, with the subscriber's consent. Details on the Tracking and statistics page. |
| Keep tracking counters for (days) | 365 | Range 30 to 3650. mmd:newsletter:tracking:purge deletes older counters. |
| Wording of the tracking consent checkbox | empty (the plugin's default text) | Only visible in "Personal" mode. Text of the optional checkbox, at most 1000 characters. It is stored with every consent as proof. |
| Keep personal tracking events for (days) | 90 | Only visible in "Personal" mode. Range 7 to 730. mmd:newsletter:tracking:purge takes care of this as well. |
| Mailer transport for newsletters | empty (default transport) | Name of a Symfony Mailer transport that carries only this channel's newsletters (see Dedicated mailer transport). Letters, digits, _, . and - are allowed. |
| Sender name | channel name | Sender name of the emails. |
| Sender email | channel contact email | Sender address of the emails. Must be a valid email address. |
When the two purge commands must run and how to set them up as cronjobs is covered on the Installation and operation page. The retention periods only take effect once the commands run regularly.
Sender
The plugin has two mail paths, and both use the channel's sender:
- Confirmation, welcome and "already subscribed" emails go through the Sylius mailer. The sender name is the "Sender name" setting, otherwise the channel name. The sender address is the "Sender email" setting, otherwise the channel's contact email, and finally the default sender from
sylius_mailer. - Newsletters go through the Symfony Mailer. The sender name is "Sender name", otherwise the channel name. The sender address is "Sender email", otherwise the channel's contact email. If both are missing, the newsletter can be neither sent nor test-sent, and the admin tells you so.
Privacy policy link
The consent checkbox of the signup form links to your privacy policy as soon as "Privacy policy page" is set. The link opens in a new tab so a half-filled form is not lost. Three notations are accepted:
| Notation | Example | Behavior |
|---|---|---|
| Route name | shop_legal_datenschutz |
The URL is generated from the route. If the route has a {_locale} placeholder, the plugin fills in the current language. |
| Path | /{_locale}/privacy |
{_locale} is replaced by the code of the current language, for example en. A path starts with exactly one /. |
| Full URL | https://example.com/{_locale}/privacy |
Starts with http:// or https://. {_locale} is replaced as well. |
A route name that does not exist (renamed, typo) or that needs further parameters produces no link. The signup page still works, and the consent text simply appears without a link. Input in any other form is rejected with a validation error when you save.
Dedicated mailer transport
"Mailer transport for newsletters" separates newsletters from your regular shop mail, for example by sending them through a dedicated delivery provider. Enter the name of a transport from framework.mailer.transports. When sending a newsletter, the plugin sets the X-Transport header, which Symfony Mailer evaluates and removes before delivery.
# config/packages/mailer.yaml
framework:
mailer:
transports:
main: '%env(MAILER_DSN)%'
newsletter: '%env(MAILER_NEWSLETTER_DSN)%'
Then enter newsletter in the admin under "Mailer transport for newsletters". Without a value, the newsletter uses the default transport.
The transport applies to newsletters only. Confirmation, welcome and "already subscribed" emails keep using your shop's default transport.
Configuration file: button colors in emails
The button in the plugin's emails (confirm, manage subscription) is teal by default. If that does not match your theme, set the colors in a configuration file. This is the plugin's only bundle configuration.
| Key | Default | Description |
|---|---|---|
mmd_sylius_newsletter_management.email.button_color |
#1abb9c |
Button background as a hex color (# followed by 3 to 8 hex digits) |
mmd_sylius_newsletter_management.email.button_text_color |
#ffffff |
Button text color, same format |
# config/packages/mmd_sylius_newsletter_management.yaml
mmd_sylius_newsletter_management:
email:
button_color: '#1663CC'
button_text_color: '#ffffff'
An invalid color aborts building the container with the message Expected a hex color such as "#1663CC". The plugin reads no environment variables of its own.
Newsletter categories
Categories (for example "New products" or "Tutorials") let subscribers choose the topics they care about. Manage them under Categories or directly below the settings list.
| Field | Description |
|---|---|
| Code | Unique identifier, lowercase letters, digits, - and _ only, at most 50 characters. The code appears in the CSV export and in the Shop API. |
| Translations | Name (required) and description, per language. The description appears in the signup form below the category's checkbox. |
| Channels | The channels this category is offered in. Nothing selected = all channels. |
| Offered to customers | Only enabled categories appear in the form. New categories are enabled. |
| Position | Sort order in the list and in the form, ascending. Default 0. |
How categories behave:
- The signup form and the page for managing a subscription only offer enabled categories of their own channel. If there are none, no choice is shown and every subscriber gets the general newsletter.
- A subscriber who picks no category gets everything. When you send a newsletter that has categories assigned, it goes to subscribers with at least one matching category and to subscribers without any category. A newsletter without categories goes to every confirmed subscriber of the channel.
- A category restricted to other channels cannot be chosen, not even with a crafted request.
Admin lists
| List | Editable? | Columns | Filters |
|---|---|---|---|
| Newsletter settings (landing page) | Create, edit, delete | Channel, Newsletter enabled, Double opt-in, Sender email | none |
| Categories | Create, edit, delete | Position, Code, Name, Offered to customers | none (sorted by position) |
| Subscribers | View and delete only. Signups are created by the customer; an admin neither creates nor edits them. | Email, Name, Status, Channel, Signed up at, Confirmed at (default: newest first) | Search (email, first name, last name), Status, Channel |
| Newsletters | Create, view, edit, delete | Subject, Channel, Recipients, Language, Status, Sent on, Last changed | Search (subject), Channel, Status |
A subscriber's detail page shows, among other things, the source (storefront form, API, registration or admin), language, time and IP address of signup and confirmation, and the time of unsubscribing, as proof of consent. The newsletter list is covered on Writing and sending newsletters.
Subscriber CSV export
The title bar of the subscriber list has two buttons: Export confirmed (CSV) and Export all (CSV). The file is named newsletter-subscribers-YYYY-MM-DD.csv. It is UTF-8 encoded with a BOM so Excel displays umlauts correctly, and uses ; as the separator.
| Column | Content |
|---|---|
email |
Email address |
first_name, last_name |
First and last name, if given |
status |
pending, confirmed or unsubscribed |
channel |
Code of the channel |
locale |
Language at signup |
tracking_consent |
yes or no |
categories |
Codes of the selected categories, comma-separated |
signed_up_at, confirmed_at, unsubscribed_at |
Timestamps in the format YYYY-MM-DD HH:MM:SS |
You can narrow the export with URL parameters: /admin/newsletter-subscriptions/export?status=confirmed&channel=de_shop&category=news. status accepts pending, confirmed and unsubscribed (any other value returns error 400), channel the code of a channel, category the code of a category. The admin part of the path is your shop's configured admin path. Cells starting with =, +, - or @ get a leading apostrophe so spreadsheet software does not execute them as formulas.
Practical examples
German shop with double opt-in
A shop with one channel de_shop that runs its newsletter in a privacy-compliant way:
| Setting | Value |
|---|---|
| Channel | de_shop |
| Newsletter enabled | on |
| Double opt-in | on |
| Signup form in the footer | on |
| Privacy policy page | /{_locale}/datenschutz |
| Sender name | Beispiel-Shop |
| Sender email | newsletter@beispiel-shop.de |
| Keep unsubscribed subscriptions for (days) | 1095 |
| Keep unconfirmed signups for (days) | 30 |
If your shop provides the privacy policy as a route instead (for example shop_legal_datenschutz), enter the route name and the language is taken into account automatically.
Multiple channels with separate senders
A shop runs de_shop and en_shop. Create separate settings for each channel, because sender, privacy page and transport apply per channel:
| Setting | de_shop |
en_shop |
|---|---|---|
| Sender name | Beispiel-Shop |
Example Shop |
| Sender email | newsletter@beispiel-shop.de |
newsletter@example-shop.com |
| Privacy policy page | /de/datenschutz |
/en/privacy |
| Mailer transport for newsletters | newsletter |
empty |
If you create the category "New products" without selecting a channel, it appears in both channels. If you select only de_shop for the category "Germany only", only that channel offers it. A subscription always belongs to one channel; the same email address can be subscribed separately in both channels.
Personal tracking with consent
You want to know who opens and clicks your newsletter, but only with consent:
| Setting | Value |
|---|---|
| Tracking | Personal, with the subscriber's consent |
| Keep tracking counters for (days) | 365 |
| Keep personal tracking events for (days) | 90 |
| Wording of the tracking consent checkbox | I agree that my opening of this newsletter and my clicks on its links are recorded individually so we can improve the newsletter. I can withdraw this at any time. |
The signup form then shows an additional, optional checkbox with this text, separate from the consent to receive the newsletter. The wording is stored with every consent. Subscribers who leave the checkbox unticked still receive the newsletter but are only counted anonymously.
You have to mention any tracking in your privacy policy.