Description
Symfony version(s) affected
^7
Description
If an email contains attachments > postmark threshold, postmark will return an error with the following payload:
array (
'message' => 'Request size limit exceeded',
'request_id' => 'xxxx',
)
Status Code = 413
However according to this line here:
The error message is expecting the key to be Capitalized, causing the error descibed above "Undefined array key 'Message'"
How to reproduce
Add attachments > postmark threshold to an email
Attempt to send
error, Undefined array key 'Message'
Possible Solution
It appears the symfony mailer is expecting API Error codes and the response to always be formatted with
["ErrorCode", "Message"]
However if the response is a Http error code, the payload may not be in this format.
A suggested approach here would be to create a block just for 413 HTTP errors, and return the response based on the output above with the 'message' key
Additional Context
No response