- How do I install symfony/sendgrid-mailer in a Laravel application?
- Install it with Composer using composer require symfony/sendgrid-mailer. Laravel's mail layer is built on Symfony Mailer, so the bridge can be used with Laravel's existing mail configuration. After installation, configure a SendGrid DSN in your environment and point your Laravel mailer at it.
- Does symfony/sendgrid-mailer work with Laravel's Mail facade?
- Yes. Laravel's illuminate/mail component uses Symfony Mailer underneath, so the SendGrid bridge can integrate with Laravel's Mail facade. You configure a Laravel mailer to use a sendgrid+api or sendgrid+smtp DSN. Some SendGrid-specific features, such as Send-At scheduling, require the API transport.
- What is the difference between sendgrid+smtp and sendgrid+api DSNs?
- The sendgrid+smtp DSN sends mail through SendGrid's SMTP endpoint and is useful for legacy or SMTP-compatible setups. The sendgrid+api DSN uses SendGrid's HTTP API and is required for features such as scheduling with the Send-At header. Choose the API transport when you need SendGrid-specific capabilities beyond basic delivery.
- How do I configure the SendGrid API key and region in Laravel?
- Use a DSN such as sendgrid+api://KEY@default?region=REGION, where KEY is your SendGrid API key. The region is optional and defaults to SendGrid's global region. Store the key in your environment or secret manager rather than committing it to configuration files.
- How do I set up SendGrid webhooks with symfony/sendgrid-mailer in Laravel?
- The package uses Symfony's Webhook component, so you need to register the SendGrid webhook request parser, configure a routing secret, and create a RemoteEvent consumer. In Laravel this usually means bridging Symfony's webhook routing and remote event handling into your application. Configure the SendGrid validation secret correctly so incoming events can be verified.
- Why are my SendGrid webhook events being rejected after upgrading to v8.1.7?
- Version 8.1.7 verifies webhook signatures before parsing payloads, which is a security hardening change. If the SendGrid webhook secret is missing, incorrect, or not loaded from environment configuration, events will be rejected. Confirm the secret matches SendGrid's validation secret and is available to the webhook parser at runtime.
- How do I schedule SendGrid emails with the Send-At header in Laravel?
- Use the sendgrid+api DSN and add a DateHeader named Send-At with a DateTimeInterface value to the email. The bridge maps that header to SendGrid's send_at parameter on the mail send API endpoint. Scheduling is not available through the SMTP transport, so confirm your Laravel mailer is using the API DSN.
- How do suppression groups work with symfony/sendgrid-mailer?
- Add a SuppressionGroupHeader to the email, passing the SendGrid suppression group ID and the group IDs to display to the user. This lets SendGrid apply unsubscribe and suppression behavior associated with those groups. Validate the header behavior against your existing GDPR and opt-out workflows before relying on it in production.
- What PHP and Laravel versions does symfony/sendgrid-mailer support?
- The bridge follows Symfony Mailer's PHP requirements, and v8.1.7 keeps compatibility aligned with PHP 8.4+. Laravel version support depends on the Symfony Mailer constraints that your Laravel release allows. Check the package's Composer requirements and test against your exact Laravel and PHP versions before upgrading.
- Should I use symfony/sendgrid-mailer for high-volume production sending in Laravel, or consider alternatives?
- It is a reasonable fit when you want native Symfony Mailer integration and SendGrid-specific features without custom SDK plumbing. For high-volume sending, plan for SendGrid API rate limits, webhook delivery gaps, retries, and monitoring. Consider SMTP fallback or a circuit breaker for API failures, and evaluate SendGrid's official SDK or other mailers if you need Laravel-specific abstractions.