Skip to content

[Mailer][MailPace] "throw new HttpTransportException" cause a "Undefined array key 'Message' or 'ErrorCode' " #49169

@selimanac

Description

@selimanac

Symfony version(s) affected

6.2.5

Description

mail-pace-mailer failed to throw new HttpTransportException because of the missing array keys.

When return status code is not 200, it failed because of the typo on line 70.
$result array doesn't contain Message or ErrorCode

Instead of Message , mail-pace api returns error:

  "error" => "Invalid API Token"

mail-pace api responses: https://docs.mailpace.com/reference/responses

How to reproduce

Just use a any wrong API key or send it with not verified domain.

Possible Solution

Changing Message to error and $result['ErrorCode'] to $statusCode might fix it.

throw new HttpTransportException('Unable to send an email: '.$result['error'].sprintf(' (code %d).', $statusCode), $response);

Additional Context

No response

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