itzbund / gsb-newsletter
Newsletter extension for the Goverment Site Build (GSB) 11. This is part of the Government Site Builder (GSB) 11. The GSB 11 is a measure of the Dienstekonsolidierung Bund (DKB) of the Federal Ministry of the Interior and for Homeland (BMI) and is carried out on behalf of the Information Technology
Package info
gitlab.opencode.de/bmi/government-site-builder-11/extensions/gsb_newsletter
Type:typo3-cms-extension
pkg:composer/itzbund/gsb-newsletter
Requires
- php: ^8.3
- ext-curl: *
- ext-filter: *
- ext-mbstring: *
- ext-openssl: *
- itzbund/gsb-core: ^5.0@rc || dev-main
- symfony/console: *
- symfony/yaml: *
- typo3/cms-backend: ^13.4
- typo3/cms-core: ^13.4
- typo3/cms-extbase: ^13.4
- typo3/cms-fluid: ^13.4
- typo3/cms-frontend: ^13.4
- typo3/cms-install: ^13.4
- typo3/cms-scheduler: ^13.4
Requires (Dev)
- ergebnis/composer-normalize: ^2.47.0
- helmich/typo3-typoscript-lint: ^3.3.0
- phpmd/phpmd: ^3.0
- shipmonk/composer-dependency-analyser: ^1.8
- ssch/typo3-rector: ^3.5
- typo3/coding-standards: ^0.9
- typo3/testing-framework: ^8.2
Suggests
- ext-redis: *
Provides
None
Conflicts
None
Replaces
None
- dev-next / 4.x-dev
- dev-main / 1.x-dev
- v1.12.0-beta.29
- v1.12.0-beta.28
- v1.12.0-beta.27
- v1.12.0-beta.26
- v1.12.0-beta.25
- v1.12.0-beta.24
- v1.12.0-beta.23
- v1.12.0-beta.22
- v1.12.0-beta.21
- v1.12.0-beta.20
- v1.12.0-beta.19
- v1.12.0-beta.18
- v1.12.0-beta.17
- v1.12.0-beta.16
- v1.12.0-beta.15
- v1.12.0-beta.14
- v1.12.0-beta.13
- v1.12.0-beta.12
- v1.12.0-beta.11
- v1.12.0-beta.10
- v1.12.0-beta.9
- v1.12.0-beta.8
- v1.12.0-beta.7
- v1.12.0-beta.6
- v1.12.0-beta.5
- v1.12.0-beta.4
- v1.12.0-beta.3
- v1.12.0-beta.2
- v1.12.0-beta.1
- v1.11.4-rc.1
- v1.11.3
- v1.11.3-rc.9
- v1.11.3-rc.8
- v1.11.3-rc.7
- v1.11.3-rc.6
- v1.11.3-rc.5
- v1.11.3-rc.4
- v1.11.3-rc.3
- v1.11.3-rc.2
- v1.11.3-rc.1
- v1.11.2
- v1.11.2-rc.15
- v1.11.2-rc.14
- v1.11.2-rc.13
- v1.11.2-rc.12
- v1.11.2-rc.11
- v1.11.2-rc.10
- v1.11.2-rc.9
- v1.11.2-rc.8
- v1.11.2-rc.7
- v1.11.2-rc.6
- v1.11.2-rc.5
- v1.11.2-rc.4
- v1.11.2-rc.3
- v1.11.2-rc.2
- v1.11.2-rc.1
- v1.11.1
- v1.11.0
- v1.11.0-rc.15
- v1.11.0-rc.14
- v1.11.0-rc.13
- v1.11.0-rc.12
- v1.11.0-rc.11
- v1.11.0-rc.10
- v1.11.0-rc.9
- v1.11.0-rc.8
- v1.11.0-rc.7
- v1.11.0-rc.6
- v1.11.0-rc.5
- v1.11.0-rc.4
- v1.11.0-rc.3
- v1.11.0-rc.2
- v1.11.0-rc.1
- v1.11.0-beta.20
- v1.11.0-beta.19
- v1.11.0-beta.18
- v1.11.0-beta.17
- v1.11.0-beta.16
- v1.11.0-beta.15
- v1.11.0-beta.14
- v1.11.0-beta.13
- v1.11.0-beta.12
- v1.11.0-beta.11
- v1.11.0-beta.10
- v1.11.0-beta.9
- v1.11.0-beta.8
- v1.11.0-beta.7
- v1.11.0-beta.6
- v1.11.0-beta.5
- v1.11.0-beta.4
- v1.11.0-beta.3
- v1.11.0-beta.2
- v1.11.0-beta.1
- v1.10.0
- v1.10.0-rc.3
- v1.10.0-rc.2
- v1.10.0-rc.1
- v1.10.0-beta.40
- v1.10.0-beta.39
- v1.10.0-beta.38
- v1.10.0-beta.37
- v1.10.0-beta.36
- v1.10.0-beta.35
- v1.10.0-beta.34
- v1.10.0-beta.33
- v1.10.0-beta.32
- v1.10.0-beta.31
- v1.10.0-beta.30
- v1.10.0-beta.29
- v1.10.0-beta.28
- v1.10.0-beta.27
- v1.10.0-beta.26
- v1.10.0-beta.25
- v1.10.0-beta.24
- v1.10.0-beta.23
- v1.10.0-beta.22
- v1.10.0-beta.21
- v1.10.0-beta.20
- v1.10.0-beta.19
- v1.10.0-beta.18
- v1.10.0-beta.17
- v1.10.0-beta.16
- v1.10.0-beta.15
- v1.10.0-beta.14
- v1.10.0-beta.13
- v1.10.0-beta.12
- v1.10.0-beta.11
- v1.10.0-beta.10
- v1.10.0-beta.9
- v1.10.0-beta.8
- v1.10.0-beta.7
- v1.10.0-beta.6
- v1.10.0-beta.5
- v1.10.0-beta.4
- v1.10.0-beta.3
- v1.10.0-beta.2
- v1.10.0-beta.1
- v1.9.4
- v1.9.4-rc.5
- v1.9.4-rc.4
- v1.9.4-rc.3
- v1.9.4-rc.2
- v1.9.4-rc.1
- v1.9.3
- v1.9.3-rc.6
- v1.9.3-rc.5
- v1.9.3-rc.4
- v1.9.3-rc.3
- v1.9.3-rc.2
- v1.9.3-rc.1
- v1.9.2
- v1.9.2-rc.4
- v1.9.2-rc.3
- v1.9.2-rc.2
- v1.9.2-rc.1
- v1.9.1
- v1.9.1-rc.6
- v1.9.1-rc.5
- v1.9.1-rc.4
- v1.9.1-rc.3
- v1.9.1-rc.2
- v1.9.1-rc.1
- v1.9.1-beta.4
- v1.9.1-beta.3
- v1.9.1-beta.2
- v1.9.1-beta.1
- v1.9.0
- v1.9.0-rc.4
- v1.9.0-rc.3
- v1.9.0-rc.2
- v1.9.0-rc.1
- v1.9.0-beta.5
- v1.9.0-beta.4
- v1.9.0-beta.3
- v1.9.0-beta.2
- v1.9.0-beta.1
- v1.8.1-rc.5
- v1.8.1-rc.4
- v1.8.1-rc.3
- v1.8.1-rc.2
- v1.8.1-rc.1
- v1.8.0
- v1.8.0-rc.13
- v1.8.0-rc.12
- v1.8.0-rc.11
- v1.8.0-rc.10
- v1.8.0-rc.9
- v1.8.0-rc.8
- v1.8.0-rc.7
- v1.8.0-rc.6
- v1.8.0-rc.5
- v1.8.0-rc.4
- v1.8.0-rc.3
- v1.8.0-rc.2
- v1.8.0-rc.1
- v1.7.2-rc.1
- v1.7.1
- v1.7.1-rc.12
- v1.7.1-rc.11
- v1.7.1-rc.10
- v1.7.1-rc.9
- v1.7.1-rc.8
- v1.7.1-rc.7
- v1.7.1-rc.6
- v1.7.1-rc.5
- v1.7.1-rc.4
- v1.7.1-rc.3
- v1.7.1-rc.2
- v1.7.1-rc.1
- v1.7.0
- v1.7.0-rc.8
- v1.7.0-rc.7
- v1.7.0-rc.6
- v1.7.0-rc.5
- v1.7.0-rc.4
- v1.7.0-rc.3
- v1.7.0-rc.2
- v1.7.0-rc.1
- v1.6.1-rc.7
- v1.6.1-rc.6
- v1.6.1-rc.5
- v1.6.1-rc.4
- v1.6.1-rc.3
- v1.6.1-rc.2
- v1.6.1-rc.1
- v1.6.0
- v1.6.0-rc.11
- v1.6.0-rc.10
- v1.6.0-rc.9
- v1.6.0-rc.8
- v1.6.0-rc.7
- v1.6.0-rc.6
- v1.6.0-rc.5
- v1.6.0-rc.4
- v1.6.0-rc.3
- v1.6.0-rc.2
- v1.6.0-rc.1
- v1.5.0
- v1.5.0-rc.14
- v1.5.0-rc.13
- v1.5.0-rc.12
- v1.5.0-rc.11
- v1.5.0-rc.10
- v1.5.0-rc.9
- v1.5.0-rc.8
- v1.5.0-rc.7
- v1.5.0-rc.6
- v1.5.0-rc.5
- v1.5.0-rc.4
- v1.5.0-rc.3
- v1.5.0-rc.2
- v1.5.0-rc.1
- v1.4.2-rc.5
- v1.4.2-rc.4
- v1.4.2-rc.3
- v1.4.2-rc.2
- v1.4.2-rc.1
- v1.4.1
- v1.4.1-rc.3
- v1.4.1-rc.2
- v1.4.1-rc.1
- v1.4.0
- v1.4.0-rc.11
- v1.4.0-rc.10
- v1.4.0-rc.9
- v1.4.0-rc.8
- v1.4.0-rc.7
- v1.4.0-rc.6
- v1.4.0-rc.5
- v1.4.0-rc.4
- v1.4.0-rc.3
- v1.4.0-rc.2
- v1.4.0-rc.1
- v1.3.0
- v1.3.0-rc.34
- v1.3.0-rc.33
- v1.3.0-rc.32
- v1.3.0-rc.31
- v1.3.0-rc.30
- v1.3.0-rc.29
- v1.3.0-rc.28
- v1.3.0-rc.27
- v1.3.0-rc.26
- v1.3.0-rc.25
- v1.3.0-rc.24
- v1.3.0-rc.23
- v1.3.0-rc.22
- v1.3.0-rc.21
- v1.3.0-rc.20
- v1.3.0-rc.19
- v1.3.0-rc.18
- v1.3.0-rc.17
- v1.3.0-rc.16
- v1.3.0-rc.15
- v1.3.0-rc.14
- v1.3.0-rc.13
- v1.3.0-rc.12
- v1.3.0-rc.11
- v1.3.0-rc.10
- v1.3.0-rc.9
- v1.3.0-rc.8
- v1.3.0-rc.7
- v1.3.0-rc.6
- v1.3.0-rc.5
- v1.3.0-rc.4
- v1.3.0-rc.3
- v1.3.0-rc.2
- v1.3.0-rc.1
- v1.2.3-rc.8
- v1.2.3-rc.7
- v1.2.3-rc.6
- v1.2.3-rc.5
- v1.2.3-rc.4
- v1.2.3-rc.3
- v1.2.3-rc.2
- v1.2.3-rc.1
- v1.2.2
- v1.2.2-rc.2
- v1.2.2-rc.1
- v1.2.1
- v1.2.1-rc.38
- v1.2.1-rc.37
- v1.2.1-rc.36
- v1.2.1-rc.35
- v1.2.1-rc.34
- v1.2.1-rc.33
- v1.2.1-rc.32
- v1.2.1-rc.31
- v1.2.1-rc.30
- v1.2.1-rc.29
- v1.2.1-rc.28
- v1.2.1-rc.27
- v1.2.1-rc.26
- v1.2.1-rc.25
- v1.2.1-rc.24
- v1.2.1-rc.23
- v1.2.1-rc.22
- v1.2.1-rc.21
- v1.2.1-rc.20
- v1.2.1-rc.19
- v1.2.1-rc.18
- v1.2.1-rc.17
- v1.2.1-rc.16
- v1.2.1-rc.15
- v1.2.1-rc.14
- v1.2.1-rc.13
- v1.2.1-rc.12
- v1.2.1-rc.11
- v1.2.1-rc.10
- v1.2.1-rc.9
- v1.2.1-rc.8
- v1.2.1-rc.7
- v1.2.1-rc.6
- v1.2.1-rc.5
- v1.2.1-rc.4
- v1.2.1-rc.3
- v1.2.1-rc.2
- v1.2.1-rc.1
- v1.2.0
- v1.2.0-rc.1
- v1.1.2-rc.25
- v1.1.2-rc.24
- v1.1.2-rc.23
- v1.1.2-rc.22
- v1.1.2-rc.21
- v1.1.2-rc.20
- v1.1.2-rc.19
- v1.1.2-rc.18
- v1.1.2-rc.17
- v1.1.2-rc.16
- v1.1.2-rc.15
- v1.1.2-rc.14
- v1.1.2-rc.13
- v1.1.2-rc.12
- v1.1.2-rc.11
- v1.1.2-rc.10
- v1.1.2-rc.9
- v1.1.2-rc.8
- v1.1.2-rc.7
- v1.1.2-rc.6
- v1.1.2-rc.5
- v1.1.2-rc.4
- v1.1.2-rc.3
- v1.1.2-rc.2
- v1.1.2-rc.1
- v1.1.1
- v1.1.1-rc.48
- v1.1.1-rc.47
- v1.1.1-rc.46
- v1.1.1-rc.45
- v1.1.1-rc.44
- v1.1.1-rc.43
- v1.1.1-rc.42
- v1.1.1-rc.41
- v1.1.1-rc.40
- v1.1.1-rc.39
- v1.1.1-rc.38
- v1.1.1-rc.37
- v1.1.1-rc.36
- v1.1.1-rc.35
- v1.1.1-rc.34
- v1.1.1-rc.33
- v1.1.1-rc.32
- v1.1.1-rc.31
- v1.1.1-rc.30
- v1.1.1-rc.29
- v1.1.1-rc.28
- v1.1.1-rc.27
- v1.1.1-rc.26
- v1.1.1-rc.25
- v1.1.1-rc.24
- v1.1.1-rc.23
- v1.1.1-rc.22
- v1.1.1-rc.21
- v1.1.1-rc.20
- v1.1.1-rc.19
- v1.1.1-rc.18
- v1.1.1-rc.17
- v1.1.1-rc.16
- v1.1.1-rc.15
- v1.1.1-rc.14
- v1.1.1-rc.13
- v1.1.1-rc.12
- v1.1.1-rc.11
- v1.1.1-rc.10
- v1.1.1-rc.9
- v1.1.1-rc.8
- v1.1.1-rc.7
- v1.1.1-rc.6
- v1.1.1-rc.5
- v1.1.1-rc.4
- v1.1.1-rc.3
- v1.1.1-rc.2
- v1.1.1-rc.1
- v1.1.0
- v1.1.0-rc.10
- v1.1.0-rc.9
- v1.1.0-rc.8
- v1.1.0-rc.7
- v1.1.0-rc.6
- v1.1.0-rc.5
- v1.1.0-rc.4
- v1.1.0-rc.3
- v1.1.0-rc.2
- v1.1.0-rc.1
- v1.0.1-rc.12
- v1.0.1-rc.11
- v1.0.1-rc.10
- v1.0.1-rc.9
- v1.0.1-rc.8
- v1.0.1-rc.7
- v1.0.1-rc.6
- v1.0.1-rc.5
- v1.0.1-rc.4
- v1.0.1-rc.3
- v1.0.1-rc.2
- v1.0.1-rc.1
- v1.0.0
- v1.0.0-rc.28
- v1.0.0-rc.27
- v1.0.0-rc.26
- v1.0.0-rc.25
- v1.0.0-rc.24
- v1.0.0-rc.23
- v1.0.0-rc.22
- v1.0.0-rc.21
- v1.0.0-rc.20
- v1.0.0-rc.19
- v1.0.0-rc.18
- v1.0.0-rc.17
- v1.0.0-rc.16
- v1.0.0-rc.15
- v1.0.0-rc.14
- v1.0.0-rc.13
- v1.0.0-rc.12
- v1.0.0-rc.11
- v1.0.0-rc.10
- v1.0.0-rc.9
- v1.0.0-rc.8
- v1.0.0-rc.7
- v1.0.0-rc.6
- v1.0.0-rc.5
- v1.0.0-rc.4
- v1.0.0-rc.3
- v1.0.0-rc.2
- v1.0.0-rc.1
- dev-release
This package is auto-updated.
Last update: 2026-12-03 19:21:22 UTC
README
GSB 11 Extension gsb_newsletter
About
This extension handles newsletter subscription, unsubscription, and sending via Listmonk (HTTP/JSON API).
Installation
The best way to install this extension is to start with the GSB Sitepackage Kickstarter extension.
For a self-hosted Listmonk setup, follow this order:
Listmonk (self-hosting)
When you self-host GSB, Listmonk is the newsletter backend. TYPO3 talks to Listmonk over its HTTP/JSON API. Listmonk must be reachable from the TYPO3 application (typically on the same Docker/Kubernetes network); it does not need to be publicly exposed.
Official Listmonk docs: Installation, API.
Environment variables
Set these variables for the TYPO3 process. They are used by the Listmonk upgrade wizards and for admin-level API access.
| Variable | Required | Description |
|---|---|---|
GSB_NEWSLETTER_HOST | yes | Hostname or URL of the Listmonk service as seen from TYPO3 (e.g. listmonk or https://listmonk.internal). |
GSB_NEWSLETTER_PORT | yes | Listmonk HTTP port (default 9000). |
GSB_NEWSLETTER_API_USER | yes | Listmonk admin API username (used by upgrade wizards to bootstrap roles, lists, and site users). |
GSB_NEWSLETTER_API_PASSWORD | yes | Listmonk admin API password / token. |
TYPO3__MAIL__defaultMailFromAddress | yes | Default sender address. Written to site setting newsletter.api.senderEmail and used as Listmonk from_email. |
TYPO3__MAIL__transport_smtp_server | yes (production) | SMTP host for Listmonk outbound mail, optionally with port (host:port). Copied into Listmonk settings by the SMTP upgrade wizard. |
TYPO3__MAIL__transport_smtp_username | no | SMTP username; if both username and password are set, Listmonk uses login auth. |
TYPO3__MAIL__transport_smtp_password | no | SMTP password. |
Example (Compose / DDEV-style):
- GSB_NEWSLETTER_HOST=listmonk
- GSB_NEWSLETTER_PORT=9000
- GSB_NEWSLETTER_API_USER=api_user
- GSB_NEWSLETTER_API_PASSWORD=<strong-secret>
- TYPO3__MAIL__defaultMailFromAddress=noreply@example.org
- TYPO3__MAIL__transport_smtp_server=smtp.example.org:587
- TYPO3__MAIL__transport_smtp_username=<smtp-user>
- TYPO3__MAIL__transport_smtp_password=<smtp-password>
After the per-site upgrade wizard has run, day-to-day API calls use the site-specific credentials stored in site settings (newsletter.api.username / newsletter.api.password), not the admin env vars.
Installing Listmonk
Listmonk needs PostgreSQL and an SMTP relay. Recommended: Docker Compose with the official image.
Minimal outline (see listmonk installation for the full compose file):
curl -LO https://github.com/knadh/listmonk/raw/master/docker-compose.yml
# Adjust DB passwords, ports, and volumes for your environment
LISTMONK_ADMIN_USER=admin LISTMONK_ADMIN_PASSWORD=<strong-secret> docker compose up -d
Key points for GSB:
- Expose Listmonk on port 9000 (or set
GSB_NEWSLETTER_PORTaccordingly). - Ensure TYPO3 can resolve
GSB_NEWSLETTER_HOST(same Docker network / cluster DNS). - Persist PostgreSQL and the Listmonk uploads volume.
- Create the admin user on first start (
LISTMONK_ADMIN_USER/LISTMONK_ADMIN_PASSWORD, or via the web UI athttp://<host>:9000). - Use those admin credentials as
GSB_NEWSLETTER_API_USER/GSB_NEWSLETTER_API_PASSWORDin TYPO3. - Provide a real SMTP relay (not the TYPO3 app server as public sender). Configure SPF/DKIM/DMARC for the sender domain.
A local DDEV reference stack lives in the project’s .ddev/docker-compose.listmonk.yaml (Listmonk + Postgres, profile listmonk). Production deployments should use hardened secrets and your own SMTP provider—not the DDEV defaults.
Configuring Listmonk for GSB
Prerequisites: Listmonk is running and environment variables are set.
Apply the Listmonk SiteSet to each site that should use Listmonk:
- Site set name:
itzbund-gsb/newsletter-listmonk - Depends on
itzbund-gsb/newsletter - In the GSB default site package this is typically already included.
- Site set name:
Run the TYPO3 upgrade wizards (Install Tool → Upgrade Wizard, or CLI). They are ordered by identifier prefix and should be executed in this order:
Identifier Title What it does gsbnewsletter_a_initialListmonkNewsletterSettingsWizardListmonk newsletter setup Destructive bootstrap: deletes all Listmonk lists, subscribers, and templates other than IDs 1/3, then sets campaign template1and transactional template3(HTML viaTx.Data.html_body), and creates user role GSB. Do not run against a populated production Listmonk instance.gsbnewsletter_b_listmonkApiUserPerSiteWizardListmonk API User setup per site Per site: creates list, list role, API user ( newsletter_gsb_<rootPageId>), writes site settings.gsbnewsletter_c_initialListmonkSmtpSettingsWizardListmonk SMTP setup Writes SMTP from TYPO3__MAIL__transport_smtp_*into Listmonk; disables update checks.gsbnewsletter_d_listmonkUserRolePermissionsWizardListmonk user role permissions (GSB) Ensures role GSB has the full permission set including media:manage(required after A/B). Permissions:subscribers:get,subscribers:manage,subscribers:sql_query,tx:send,campaigns:manage,campaigns:send,media:manage.gsbnewsletter_e_ensureNewsletterSchedulerTaskWizardEnsure newsletter scheduler task Creates one recurring Newsletter delivery ( NLSchedulerTask) scheduler task with a 60-second interval if none exists. Does not create a duplicate.Run all four Listmonk wizards. Stopping after A/B leaves the GSB role without
media:manage. Run wizard E so automatic sending has a scheduler task.Example CLI:
vendor/bin/typo3 upgrade:run gsbnewsletter_a_initialListmonkNewsletterSettingsWizard vendor/bin/typo3 upgrade:run gsbnewsletter_b_listmonkApiUserPerSiteWizard vendor/bin/typo3 upgrade:run gsbnewsletter_c_initialListmonkSmtpSettingsWizard vendor/bin/typo3 upgrade:run gsbnewsletter_d_listmonkUserRolePermissionsWizard vendor/bin/typo3 upgrade:run gsbnewsletter_e_ensureNewsletterSchedulerTaskWizardSite settings written by the wizards (under
config/sites/<site>/settings.yaml):Setting Purpose newsletter.api.urlFrom GSB_NEWSLETTER_HOSTnewsletter.api.portFrom GSB_NEWSLETTER_PORTnewsletter.api.defaultListNameListmonk list ID for this site newsletter.api.username/newsletter.api.passwordPer-site API user (password encrypted) newsletter.api.senderEmailFrom TYPO3__MAIL__defaultMailFromAddressnewsletter.listmonk.transactionalTemplateIdSet to 3by the wizards (site-set definition default is0until then)Verify in the Listmonk UI (or via API): lists exist, SMTP is enabled, templates
1and3match the expected bodies, and a test subscription / test email from TYPO3 succeeds.
Manual Listmonk UI setup is possible as a fallback, but the upgrade wizards are the supported path for GSB and keep sites, roles, and templates consistent.
MJML-based newsletter templates
HTML email templates for newsletters are authored in MJML and compiled into Fluid/HTML templates that are used by TYPO3.
Folder structure
MJML source files live in:
Mjml/Partials/...Mjml/Templates/...
The compiled Fluid/HTML templates live in:
Resources/Private/Partials/...Resources/Private/Templates/...
The directory structure under Mjml mirrors the structure under Resources/Private. File names are identical, only the extension differs:
Mjml/Partials/Content/Textpic.mjml→Resources/Private/Partials/Content/Textpic.htmlMjml/Templates/Newsletter/Default.mjml→Resources/Private/Templates/Newsletter/Default.html
Some content partials are Fluid-only (<mj-raw> without MJML layout); the build copies them through without compiling MJML.
How the build works
The MJML build is implemented in:
Mjml/package.jsonMjml/mjml-build.mjs
The script:
- walks all
.mjmlfiles underMjml - maps files from
Partials/...andTemplates/...to the corresponding path underResources/Private - for content partials (
Mjml/Partials/Content/*.mjml) it:- wraps MJML fragments (e.g. a single
<mj-section>) in a minimal<mjml><mj-body>…</mj-body></mjml>wrapper for compilation - compiles MJML to HTML using the
mjmlCLI library - extracts exactly the generated
<div class="…">…</div>block that corresponds to the MJML section- if the section has a
css-classattribute, that class name is used (e.g.css-class="textpic-element") - otherwise a class name is derived from the file name (e.g.
Textpic.mjml→textpic-element)
- if the section has a
- writes only this inner block to the target partial, preserving Fluid tags inside
<mj-raw>blocks
- wraps MJML fragments (e.g. a single
- for template files (
Mjml/Templates/...) it writes the full compiled HTML document to the target template file - for
.mjmlfiles outsidePartials/...andTemplates/...it logs a warning and skips them (no hard failure)
Existing Fluid code inside the MJML files (e.g. {contentElement.header}, <f:sanitize.html>…</f:sanitize.html>, loops over images) is kept as-is by using <mj-raw> in the MJML source.
Running the MJML build (local and CI)
From within the extension:
cd _packages/gsb_newsletter/Mjml
npm install # once
npm run build
It is safe to run repeatedly: the generated .html files under Resources/Private are fully overwritten based on the MJML sources and should be treated as build artefacts (single source of truth is the .mjml files).
Usage
The gsb_newsletter extension enables newsletter subscription and sending on TYPO3 pages. It talks to a Listmonk instance over HTTP/JSON; connection details come from site settings (see Configuring Listmonk for GSB).
What the extension does
- Newsletter subscription and unsubscription via dedicated content elements (double opt-in for subscribe).
- Email validation, honeypot spam protection, and a privacy checkbox on the subscription form.
- Listmonk integration for subscribers, campaigns, and transactional (test / opt-in) mails.
- List management backend module for Listmonk lists per site.
- Automatic sending via TYPO3 scheduler task based on newsletter page configuration.
- Test email field in the backend for newsletter pages.
Newsletter lists
Lists live in Listmonk, not as TYPO3 database records. TYPO3 only stores Listmonk list IDs on content elements and newsletter pages (newsletter_list).
API credentials and the default list ID come from site settings (newsletter.api.*), usually written by the upgrade wizards.
Managing lists
- In the TYPO3 backend, open Site Management → Newsletter lists (
site_gsbnewsletter_list_management). - Choose a site (root page).
- Create, edit, or delete Listmonk lists for that site via the module (calls the Listmonk API).
The site’s default list is newsletter.api.defaultListName (Listmonk list ID).
Selecting lists in content elements and pages
Subscription / unsubscription content elements and newsletter pages expose a newsletter_list field:
- TCA:
Configuration/TCA/Overrides/tt_content.php,pages.php - Options are loaded via
NewsletterList::getNewsletterLists()→SelectableNewsletterListsEvent SelectableListmonkListsEventListenerfills the dropdown from active Listmonk lists for the current site
Cardinality:
- Content elements: multi-select (
selectMultipleSideBySide) — one or more Listmonk list IDs. - Newsletter pages: single select (
selectSingle) — exactly one list for sending.
Frontend usage (subscription/unsubscription)
Ensure Listmonk lists exist Create or verify lists in Site Management → Newsletter lists (or rely on the default list from the upgrade wizard).
Subscription content element
- Go to the Page module.
- Add a content element of type
Newsletter subscription(gsbnewsletter_newslettersubscription). - Configure:
- Header and bodytext
- Optional image (with alt/title)
- Newsletter list: one or more Listmonk lists
Unsubscription content element
- Add a content element of type
Newsletter unsubscription(gsbnewsletter_newsletterunsubscription). - Configure header, bodytext, optional image, and the list(s) to unsubscribe from.
- Add a content element of type
Privacy, validation, and spam protection
- The subscription form always shows a privacy checkbox.
- Email addresses are validated before Listmonk is called.
- A honeypot field blocks simple bots.
- Subscription uses double opt-in: the user receives a confirmation mail (Listmonk transactional template) and must confirm before being added to the list(s).
Newsletter pages and sending
Newsletter content is created as pages with doktype 5766 (Newsletter page) in the TYPO3 page tree.
For these pages:
- A special backend layout and RTE preset are applied automatically via:
NewsletterPageBackendLayoutHook- RTE preset
newsletter(Configuration/RTE/Newsletter.yaml)
- The UI is optimized for e‑mail content (simplified allowed markup, etc.).
A newsletter page should:
- Belong to a site with newsletter / Listmonk site settings.
- Contain newsletter content elements (e.g. text+image) as needed for the rendered mail.
- Target a Listmonk list via
pages.newsletter_list, or fall back tonewsletter.api.defaultListName.
Test e-mail field
The extension registers FormEngine node NewsletterTestEmail (ITZBund\GsbNewsletter\Backend\FormEngine\NewsletterTestEmail):
- Shown in the page properties of newsletter pages (
tx_gsbnewsletter_test_email). - Editors can send a test e‑mail of the current newsletter to a specified address.
- Uses the same rendering and Listmonk strategy as a real send, but only a single test recipient (transactional API).
Ready to send
The scheduler picks up pages that match all of the following (NewsletterSendService::getNewslettersReadyToSend()):
| Condition | Field / value |
|---|---|
| Newsletter page | doktype = 5766 |
| Not deleted / not hidden | deleted = 0, hidden = 0 |
| Marked ready | tx_gsbnewsletter_ready_to_send = 1 |
| Schedule reached | tx_gsbnewsletter_schedule_date < now |
Editors set the schedule date and toggle ready to send in the page properties. After a successful send, the service clears the ready flag and records status / sent date.
Backend usage: scheduler task for sending
The scheduler task is registered in ext_localconf.php as NLSchedulerTask:
- Class:
ITZBund\GsbNewsletter\Task\NLSchedulerTask - Title:
Newsletter delivery
The upgrade wizard gsbnewsletter_e_ensureNewsletterSchedulerTaskWizard creates this task automatically when no NLSchedulerTask exists yet. The created task is recurring with a 60-second interval.
To configure it manually (fallback):
- In the TYPO3 backend, go to System → Scheduler.
- Create a new task.
- Choose task class Newsletter delivery (
ITZBund\GsbNewsletter\Task\NLSchedulerTask). - Configure the execution schedule (e.g. every 60 seconds).
There is no Scheduler UI field for dry run. The task class has an internal $dryRun property (default false) used only if set programmatically.
Task execution flow (NLSchedulerTask::execute()):
- Resolve the
NewsletterSendService(lazy). - Call
getNewslettersReadyToSend()(see criteria above). - For each newsletter page:
- If dry run: log that the newsletter would be sent (page ID and title) and continue.
- Otherwise call
sendNewsletter((int)$newsletter['uid'])on the service. - Log success or failure with details.
- After processing all pages, log a summary with totals and
dryRunstatus.
If any newsletter fails to send, the task logs the error and returns false so the scheduler marks the run as failed.
Extension overview and extensibility
Architecture
The extension uses a strategy pattern so the newsletter backend can be swapped without changing controllers and services. The shipped implementation is Listmonk (Strategy\NewsletterApi\Listmonk). With a single implementor of NewsletterApiInterface, Symfony DI autowires it into NewsletterApi; there is no explicit alias in Configuration/Services.yaml.
Key components:
| Component | Purpose |
|---|---|
NewsletterApiInterface | Strategy contract: subscribe, unsubscribe, sendNewsletter, sendTestEmail, sendOptInEmail (all take NewsletterConfiguration / NewsletterContent). |
NewsletterApi | Facade used by controllers and services. Validates input, translates messages and delegates to the injected strategy. |
Strategy\NewsletterApi\Listmonk | Listmonk implementation (HTTP/JSON: subscribers, campaigns, transactional mails). |
NewsletterConfiguration | DTO with Listmonk API URL, credentials, sender, list ID, and strategy options (from site settings). |
CampaignListRepository | Loads/creates Listmonk lists used by the list management module and TCA selects. |
NewsletterSendService | Collects newsletter pages, renders content and calls NewsletterApi::sendNewsletter(). |
Subscribe/unsubscribe flow:
- A frontend user submits a subscription or unsubscription form.
- The controller validates the request (including honeypot) and resolves selected Listmonk list IDs from
newsletter_list. - For subscribe: double opt-in mail is sent; after confirmation the subscriber is added in Listmonk.
- Site settings supply API URL, credentials, and sender via
NewsletterConfiguration. NewsletterApivalidates the email and delegates to the Listmonk strategy.
Send flow:
NewsletterSendServicecollects newsletter pages that are ready to send (doktype5766, ready flag, schedule date).- For each page, the service:
- Resolves the Listmonk list ID from
pages.newsletter_listornewsletter.api.defaultListName. - Builds
NewsletterConfigurationfrom site settings. - Renders the newsletter content (HTML and plain text).
- Calls
NewsletterApi::sendNewsletter()to create/send the Listmonk campaign.
- Resolves the Listmonk list ID from
- The Listmonk strategy performs the API calls and throws
ListmonkApiExceptionon error.
Custom backends
If you need a different backend, implement all five methods of NewsletterApiInterface and wire the strategy explicitly (required once more than one implementor exists):
services:
ITZBund\GsbNewsletter\Strategy\NewsletterApiInterface:
alias: Vendor\Site\Extension\Strategy\NewsletterApi\CustomBackend
ITZBund\GsbNewsletter\Strategy\NewsletterApi:
public: true
arguments:
$newsletterStrategy: '@ITZBund\GsbNewsletter\Strategy\NewsletterApiInterface'
After clearing caches, subscription, unsubscription and send operations use your custom backend; forms, list management UI, and the scheduler task stay unchanged.
Contribute
As with TYPO3, we encourage you to join the project by submitting changes. Development of the GSB 11 happens mainly in the GSB 11 TYPO3 extension repositories.
To get started, have a look at our detailed contribution walkthrough.