Problem/Motivation
When debugging sent mails, the @data parameter is a nested array which doesn't get output properly.
The logger expects variables to be a string, but $response->getData() is a nested array instead.
Also, the protocol will be spammed with warnings whenever the logged message is tried to be rendered.
Steps to reproduce
Install & setup mailjet with a demo account
Activate debugging mode
Write a mail_alter hook and purposefully malform the $message. (In my case, I added a NULL variable like so: $message['param']['Variables']['dummy'] = NULL)
Set up the mailmanager to use mailjet
Send a test mail via mailmanager
Proposed resolution
print_r the $response->getData()
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | screenshot2.jpg | 1.81 MB | vierlex |
| screenshot.jpg | 40.88 KB | vierlex |
Issue fork mailjet_api-3209097
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
vierlexComment #3
vierlexComment #4
vierlexComment #6
vierlexComment #7
vierlexComment #8
vierlexComment #9
darvanenI checked and print_r is commonly used in core for this sort of problem, so it looks good to me.
Code is fine, applies cleanly and neatly solves the problem.
It would be nice to have a test, but since this module doesn't use them yet I won't mark it as required.
Comment #10
flocondetoileThanks. Merged.
Comment #12
darvanenIs it perhaps time for a release? I see usage of this module is picking up and the fix for this issue is still hidden in the dev branch :)
Comment #13
flocondetoilea new stable release has been published.