Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Mailer][Mailchimp Bridge] Throwing undefined index _id when setting message id#34599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@monteiro
Copy link
Contributor

QA
Branch?master for features / 4.4 or 5.0 for bug fixes
Bug fix?yes
New feature?no
Deprecations?no
Tickets(no ticket created)
LicenseMIT

When I set the DSN:
MAILER_DSN=mandrill://KEY@default

and try to send an email:

$reportEmail = (newEmail())            ->subject('this is a test')            ->addFrom('test@test.com')            ->addTo('test-2@test.com')            ->text('this is just a test.');$mailer->send($reportEmail);

it returns an exception:

Captura de ecrã 2019-11-25, às 14 31 59

Stacktrace:

ErrorException:Notice: Undefined index: _id  at /Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php:64  at Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillHttpTransport->doSendHttp(object(SentMessage))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/AbstractHttpTransport.php:71)  at Symfony\Component\Mailer\Transport\AbstractHttpTransport->doSend(object(SentMessage))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/AbstractTransport.php:71)  at Symfony\Component\Mailer\Transport\AbstractTransport->send(object(SentMessage), object(DelayedEnvelope))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/Transports.php:51)  at Symfony\Component\Mailer\Transport\Transports->send(object(Email), null)     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Mailer.php:41)  at Symfony\Component\Mailer\Mailer->send(object(Email))     (src/Controller/MailerController.php:20)  at App\Controller\MailerController->index(object(Mailer))

The fix, how does it work:

According todocumentation, the endpointhttps://mandrillapp.com/api/1.0/messages/send-raw.json returns an array of results in case of success:

[    {        "email": "recipient.email@example.com",        "status": "sent",        "reject_reason": "hard-bounce",        "_id": "abc123abc123abc123abc123abc123"    }]

in case of an error:

{    "status": "error",    "code": 12,    "name": "Unknown_Subaccount",    "message": "No subaccount exists with the id 'customer-123'"}

The fix just sets the right message id.

@monteiromonteiro changed the titlemailer: mailchimp bridge is throwing undefined index _id when setting…[Mailer][Mailchimp Bridge] Throwing undefined index _id when setting message idNov 25, 2019
@fabpot
Copy link
Member

Thank you@monteiro.

fabpot added a commit that referenced this pull requestNov 26, 2019
…en setting message id (monteiro)This PR was merged into the 4.4 branch.Discussion----------[Mailer][Mailchimp Bridge] Throwing undefined index _id when setting message id| Q             | A| ------------- | ---| Branch?       | master for features / 4.4 or 5.0 for bug fixes <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       | (no ticket created)| License       | MIT<!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (seehttps://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master.-->When I set the DSN:`MAILER_DSN=mandrill://KEY@default`and try to send an email:```php$reportEmail = (new Email())            ->subject('this is a test')            ->addFrom('test@test.com')            ->addTo('test-2@test.com')            ->text('this is just a test.');$mailer->send($reportEmail);```it returns an exception:<img width="1059" alt="Captura de ecrã 2019-11-25, às 14 31 59" src="https://user-images.githubusercontent.com/74459/69549352-0a8e6480-0f91-11ea-8d6e-ecb1ecb8caa5.png">Stacktrace:```ErrorException:Notice: Undefined index: _id  at /Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php:64  at Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillHttpTransport->doSendHttp(object(SentMessage))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/AbstractHttpTransport.php:71)  at Symfony\Component\Mailer\Transport\AbstractHttpTransport->doSend(object(SentMessage))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/AbstractTransport.php:71)  at Symfony\Component\Mailer\Transport\AbstractTransport->send(object(SentMessage), object(DelayedEnvelope))     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Transport/Transports.php:51)  at Symfony\Component\Mailer\Transport\Transports->send(object(Email), null)     (/Users/mac/Documents/workspace/spotahome/code/opensource/symfony/src/Symfony/Component/Mailer/Mailer.php:41)  at Symfony\Component\Mailer\Mailer->send(object(Email))     (src/Controller/MailerController.php:20)  at App\Controller\MailerController->index(object(Mailer))```## The fix, how does it work:According to [documentation](https://mandrillapp.com/api/docs/messages.html), the endpoint `https://mandrillapp.com/api/1.0/messages/send-raw.json` returns an array of results in case of success:```[    {        "email": "recipient.email@example.com",        "status": "sent",        "reject_reason": "hard-bounce",        "_id": "abc123abc123abc123abc123abc123"    }]```in case of an error:```{    "status": "error",    "code": 12,    "name": "Unknown_Subaccount",    "message": "No subaccount exists with the id 'customer-123'"}```The fix just sets the right message id.Commits-------fa3f901 mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport
@fabpotfabpot merged commitfa3f901 intosymfony:4.4Nov 26, 2019
This was referencedDec 1, 2019
@monteiromonteiro deleted the fix/mandrill-http-transport-undefined_id_4.4 branchFebruary 29, 2020 16:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@monteiro@fabpot@stof@Arthurhall@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp