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

CommentFileSizeAuthor
#3 screenshot2.jpg1.81 MBvierlex
screenshot.jpg40.88 KBvierlex
Command icon 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

vierlex created an issue. See original summary.

vierlex’s picture

Issue summary: View changes
vierlex’s picture

Issue summary: View changes
StatusFileSize
new1.81 MB
vierlex’s picture

Issue summary: View changes

vierlex’s picture

Status: Active » Needs review
vierlex’s picture

vierlex’s picture

darvanen’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

flocondetoile’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

darvanen’s picture

Is 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 :)

flocondetoile’s picture

a new stable release has been published.