Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Mailer] Invalid Mandrill send raw api with named addresses  #36879

Copy link
Copy link
Closed
@JohJohan

Description

@JohJohan
Issue body actions

Symfony version(s) affected: 4.4.8

Description
Sending emails with the Mandrill (MailChimp) API doesn't work when using named addresses for from options. With #33993 setting address is fixed for api /api/1.0/messages/send.json but my mails are send via MandrillHttpTransport::doSendHttp() which will use /api/1.0/messages/send-raw.json. here we still set wrong from_email. More docs about send-raw are on mandrill see https://mandrillapp.com/api/docs/messages.curl.html#method-send-raw

How to reproduce

use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mailer\Transport;

$transport = Transport::fromDsn(sprintf('api://%s@mandrill', 'YOUR_KEY'));
$mailer = new Mailer($transport);

$email = new TemplatedEmail();
$email
    ->from(new Address('test@example.com', 'My Name'))
    ->subject('Subject')
    ->text('Message')
    ->to(
        new Address('recipient@example.com', 'Recipient Name')
    )
;

$mailer->send($email);

Possible Solution
The solution that was done for send will also apply for send-raw see #33993

Let me know if i should make a pull request to fix this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.