Mautic 7 on Railway: web + cron + worker template with API email (works without SMTP)

Hi! I published a Railway template for Mautic 7.2. Web, cron and the queue worker run as separate services, and settings saved in the UI reach cron and worker automatically. The cron schedule includes broadcasts:send, and SES/Brevo/Mailgun/Postmark/Resend/SendGrid API transports are built in, so email works where SMTP is blocked.

Template: Deploy & Host Mautic 7 | Railway

Repo: GitHub - TalhaRamzan/railway-mautic-7: Railway template: Mautic 7 marketing automation with cron, worker and HTTP API email · GitHub

Unofficial, and feedback is welcome.

Thanks for sharing this. Overall, the proposed approach looks sensible and follows a well-separated architecture: dedicated services for the web application, cron jobs and workers, a pinned Mautic image, a private database, and mautic:broadcasts:send included in the schedule.

It is particularly useful that the template addresses a real limitation of platforms where outbound SMTP connections are unavailable. Sending through HTTPS APIs is a good alternative to SMTP.

However, it is important to distinguish between two levels of integration:

  • A standard Symfony API transport, which provides outbound delivery without SMTP.
  • A complete provider plugin, which also processes callbacks, bounces, blocks, spam complaints, unsubscribes and suppression events.

Ready and tested Mautic plugins already exist for several providers, including SendGrid and Amazon SES. They also use APIs and do not require SMTP, while returning provider events to Mautic and updating the relevant contact status. For production use, this is generally preferable to a send-only transport, because bounce and complaint processing is just as important as delivery itself.

A logical continuation of the proposed architecture would be a separate callback-processing layer. A public endpoint could receive provider events, verify their authenticity and quickly place them into RabbitMQ or another reliable queue. A dedicated worker would then process bounces, complaints, blocks and unsubscribes asynchronously.

For a small installation, this worker could run on the same host. At higher volumes, it could be moved to a separate node and scaled independently from the web application and the outbound email queue. Reliable processing should also include retries, atomic deduplication, idempotency and a separate event journal, ensuring that repeated callback deliveries do not change a contact’s status more than once.

A few additional points may be worth clarifying:

  1. TEST.md currently says that delivery through a real API provider on Railway has not yet been tested. Since the template states that email works without SMTP, publishing an end-to-end result for at least one provider would be helpful: a test email, a campaign or segment email, queue processing by the worker, and confirmed delivery.

  2. Synchronizing config/local.php through the database means that the Mautic encryption key and email configuration are also included in database backups. This can be a valid architecture, but database access and backups must be protected accordingly.

  3. Trusting 0.0.0.0/0 and ::/0 as proxies is safe only when the application is reachable exclusively through Railway’s infrastructure and forwarded headers are reliably replaced by the platform. Otherwise, trusted proxies should be narrowed and TRUSTED_HOSTS should also be configured.

This is a good foundation for small and medium-sized Mautic installations. Adding complete provider-feedback processing through existing plugins and a dedicated callback queue would be a natural next step for this architecture.

Thanks, really appreciate you taking the time to go through it!

Good point on bounces. The API transports only send, so I’ll mention the SES/SendGrid plugins in the README for anyone running this in production. You’re also right that I haven’t done a real provider test on Railway yet. I’ll do one this week and add the results. I’ll add notes about protecting DB backups and narrowing trusted proxies too.