yar
New Member
I am configuring Mailwizz in a certain way and would like to ask if it is a good idea or a much better approach exists.
We have a website with hundreds of thousands of registered users. A small percentage are upgraded paying subscribers. The majority are free users – some active, some have been inactive for a while, so we want to be careful when contacting them.
1) Hardware and setup
I installed Mailwizz using docker compose on a lightly used dedicated server at Hetzner with AMD 5950X, 128GB RAM and NVMe. Activated Redis with 4GB memory limit and allkeys-lru eviction policy, increased MySQL pool size to 8GB (for now) and applied other MySQL settings from the knowledge base article, enabled PCNTL with 5 batches in parallel.
I followed this post on docker-compose.yml, but changed PHP from 7.2 to 8.2 and used the latest Redis and MySQL. Enabled temporary queue tables and disabled customer quota check.
To run cron, I executed
and then inside the container:
It seems important to make the cron persistent next, so that it would survive container restarts and recreation. Would you recommend running a second php container similar to mailwizz-php, but purely for cron? Could you share a configuration example for Mailwizz container with cron?
2) List organization
My intention is to have a single Mailwizz list synced at all times with the database of website users.
I began implementing a sync script to be run daily that uses the following Mailwizz endpoints:
GET /lists/LIST-UNIQUE-ID/subscribers (with pagination by 100–1000 records)
POST /lists/LIST-UNIQUE-ID/subscribers/bulk (again in blocks of 100-1000 records, important for the initial prefill)
PUT /lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
DELETE /lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
When the user deletes the account from the website, I would delete the subscriber from Mailwizz list too etc.
And in the opposite direction too: if the subscriber status becomes "Blacklisted" in Mailwizz, I will update the site DB to make sure the site also stops trying to send emails to that user (to avoid damaging the sending reputation).
I tried running such sync on a small number of records and was surprised to receive a customer email notification saying "Completed the sync custom fields process", mentioning each subscriber record. How can one turn off these customer notifications?
The sync process would maintain a number of custom fields in the list, for example:
KNOWN_SINCE: Date
SUBSCRIBES_TO_NEWSLETTER: Text (yes/no)
EVER_USED_MOBILE_APP: Text (yes/no)
EVER_USED_WEBSITE: Text (yes/no)
LAST_ACTIVITY_DATE: Date
LAST_WEBSITE_ACTIVITY_DATE: Date
LAST_APP_ACTIVITY_DATE: Date
HAS_SUBSCRIPTION_NOW: Text (yes/no)
HAD_SUBSCRIPTION_IN_PAST: Text (yes/no)
SUBSCRIPTION_EXPIRATION_DATE: Date
COUNTRY: Country
These custom fields would allow creating segments such as recently expired users, users who used website but not the app and vice versa. All from that single auto-maintained list.
For boolean values, is it advised to use checkbox type or text type custom fields? What about numerical values – text fields for those?
The rules for defining a segment seem somewhat limited. I.e. one cannot check more than 3 conditions and cannot combine AND with OR to achieve e.g. this:
KNOWN_SINCE > '2022-01-01' AND (EVER_USED_MOBILE_APP = 'no' OR LAST_APP_ACTIVITY_DATE < '2023-01-01')
To overcome such limitations, I made a simple backend Rails app that connects directly to the Mailwizz database and manipulates the custom field values if needed. Could do it via the API too, but for quick fixes that only change custom fields, the direct method seemed fast and convenient.
An example of its usage came up quickly. Recently I wanted to split a segment between two campaigns, to send one via Sendgrid and another via Amazon SES and compare the results in reports. I added a custom field and assigned "1" and "2" values to users with odd and even ordinal numbers. This custom field made it easy to define the segments in the Mailwizz UI.
It would be great to be sure that Mailwizz maintains the full send/open/click history for each subscriber. It is tempting to use the campaign feature "Change subscriber custom field value upon campaign sent", "Change subscriber custom field value upon campaign open". The worry, of course, is that as the number of custom fields grows, the performance may drop.
Is all of the above a good way to use Mailwizz? The alternative is to create multiple lists and copy/move subscribers between them, but I would struggle figuring out how to sync that with the site database.
We have a website with hundreds of thousands of registered users. A small percentage are upgraded paying subscribers. The majority are free users – some active, some have been inactive for a while, so we want to be careful when contacting them.
1) Hardware and setup
I installed Mailwizz using docker compose on a lightly used dedicated server at Hetzner with AMD 5950X, 128GB RAM and NVMe. Activated Redis with 4GB memory limit and allkeys-lru eviction policy, increased MySQL pool size to 8GB (for now) and applied other MySQL settings from the knowledge base article, enabled PCNTL with 5 batches in parallel.
I followed this post on docker-compose.yml, but changed PHP from 7.2 to 8.2 and used the latest Redis and MySQL. Enabled temporary queue tables and disabled customer quota check.
To run cron, I executed
Code:
docker compose exec mailwizz-php /bin/bash
Code:
apt update
apt install cron
crond
crontab -e
It seems important to make the cron persistent next, so that it would survive container restarts and recreation. Would you recommend running a second php container similar to mailwizz-php, but purely for cron? Could you share a configuration example for Mailwizz container with cron?
2) List organization
My intention is to have a single Mailwizz list synced at all times with the database of website users.
I began implementing a sync script to be run daily that uses the following Mailwizz endpoints:
GET /lists/LIST-UNIQUE-ID/subscribers (with pagination by 100–1000 records)
POST /lists/LIST-UNIQUE-ID/subscribers/bulk (again in blocks of 100-1000 records, important for the initial prefill)
PUT /lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
DELETE /lists/LIST-UNIQUE-ID/subscribers/SUBSCRIBER-UNIQUE-ID
When the user deletes the account from the website, I would delete the subscriber from Mailwizz list too etc.
And in the opposite direction too: if the subscriber status becomes "Blacklisted" in Mailwizz, I will update the site DB to make sure the site also stops trying to send emails to that user (to avoid damaging the sending reputation).
I tried running such sync on a small number of records and was surprised to receive a customer email notification saying "Completed the sync custom fields process", mentioning each subscriber record. How can one turn off these customer notifications?
The sync process would maintain a number of custom fields in the list, for example:
KNOWN_SINCE: Date
SUBSCRIBES_TO_NEWSLETTER: Text (yes/no)
EVER_USED_MOBILE_APP: Text (yes/no)
EVER_USED_WEBSITE: Text (yes/no)
LAST_ACTIVITY_DATE: Date
LAST_WEBSITE_ACTIVITY_DATE: Date
LAST_APP_ACTIVITY_DATE: Date
HAS_SUBSCRIPTION_NOW: Text (yes/no)
HAD_SUBSCRIPTION_IN_PAST: Text (yes/no)
SUBSCRIPTION_EXPIRATION_DATE: Date
COUNTRY: Country
These custom fields would allow creating segments such as recently expired users, users who used website but not the app and vice versa. All from that single auto-maintained list.
For boolean values, is it advised to use checkbox type or text type custom fields? What about numerical values – text fields for those?
The rules for defining a segment seem somewhat limited. I.e. one cannot check more than 3 conditions and cannot combine AND with OR to achieve e.g. this:
KNOWN_SINCE > '2022-01-01' AND (EVER_USED_MOBILE_APP = 'no' OR LAST_APP_ACTIVITY_DATE < '2023-01-01')
To overcome such limitations, I made a simple backend Rails app that connects directly to the Mailwizz database and manipulates the custom field values if needed. Could do it via the API too, but for quick fixes that only change custom fields, the direct method seemed fast and convenient.
An example of its usage came up quickly. Recently I wanted to split a segment between two campaigns, to send one via Sendgrid and another via Amazon SES and compare the results in reports. I added a custom field and assigned "1" and "2" values to users with odd and even ordinal numbers. This custom field made it easy to define the segments in the Mailwizz UI.
It would be great to be sure that Mailwizz maintains the full send/open/click history for each subscriber. It is tempting to use the campaign feature "Change subscriber custom field value upon campaign sent", "Change subscriber custom field value upon campaign open". The worry, of course, is that as the number of custom fields grows, the performance may drop.
Is all of the above a good way to use Mailwizz? The alternative is to create multiple lists and copy/move subscribers between them, but I would struggle figuring out how to sync that with the site database.
Last edited: