Skip to content

[Sendgrid-mailer] SendgridApiTransport Mailer doesn't respect envelope recipients #37870

Closed
@arendjantetteroo

Description

@arendjantetteroo

I'm trying to use the EnvelopeListener to override the email used for sending in dev mode.

Unfortunately the SendgridApiTransport uses the original email and not the envelope to get the recipients, meaning it still send emails to the original recipient.

In https://github.com/symfony/sendgrid-mailer/blob/master/Transport/SendgridApiTransport.php#L86
the getPayload function uses

$personalization = [
            'to' => array_map($addressStringifier, $email->getTo()),
            'subject' => $email->getSubject(),
        ];

instead of something like the MandrillSmtpApi which uses a getRecipients function that uses the $envelope
https://github.com/symfony/mailchimp-mailer/blob/master/Transport/MandrillApiTransport.php#L82

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions