Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.09 KB

File metadata and controls

53 lines (40 loc) · 1.09 KB

Sendgrid Bridge

Provides Sendgrid integration for Symfony Mailer.

Configuration example:

# SMTP
MAILER_DSN=sendgrid+smtp://KEY@default

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

where:

  • KEY is your Sendgrid API Key

Webhook

Create a route:

framework:
    webhook:
        routing:
            sendgrid:
                service: mailer.webhook.request_parser.sendgrid
                secret: '!SENDGRID_VALIDATION_SECRET!' # Leave blank if you dont want to use the signature validation

And a consume:

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

Resources