symfony/mailomat-mailer

Symfony Mailomat Mailer Bridge

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Type:symfony-mailer-bridge

v7.2.0 2024-09-28 08:24 UTC

This package is auto-updated.

Last update: 2024-11-29 09:06:49 UTC


README

Provides Mailomat integration for Symfony Mailer.

Mailer

Configuration example:

# .env.local

# SMTP
MAILER_DSN=mailomat+smtp://USERNAME:PASSWORD@default

# API
MAILER_DSN=mailomat+api://KEY@default

Where:

  • USERNAME is your Mailomat SMTP username (must use your full email address)
  • PASSWORD is your Mailomat SMTP password
  • KEY is your Mailomat API key

Webhook

Create a route:

framework:
    webhook:
        routing:
            mailomat:
                service: mailer.webhook.request_parser.mailomat
                secret: '%env(WEBHOOK_MAILOMAT_SECRET)%'

The configuration:

# .env.local

WEBHOOK_MAILOMAT_SECRET=your-mailomat-webhook-secret

And a consumer:

#[\Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer(name: 'mailomat')]
class MailomatConsumer implements ConsumerInterface
{
    public function consume(AbstractMailerEvent $event): void
    {
        // your code
    }
}

Where:

  • WEBHOOK_MAILOMAT_SECRET is your Mailomat Webhook secret

Resources