I noticed this, when maillog debug is enabled and running the password reset email, arrays can be dumped to the top of the screen in the body content, rather that in the maillog entry, this is because of a print_r statement when generating a log record. I've fixed this with the following patch on line 383 of sendgrid.mail.inc:

if (!empty($filters = $sendgrid_message->smtpapi->getFilters())) {
$record->body .= 'Filters:' . "\n";
foreach ($filters as $item) {
- $record->body .= print_r($item) . "\n";
+ $record->body .= print_r($item, TRUE) . "\n";
}
$record->body .= $divider;
$record->body .= $divider;

CommentFileSizeAuthor
#2 sendgrid_integration--2984307.patch806 bytesleslie.cordell

Comments

mr.les created an issue. See original summary.

leslie.cordell’s picture

StatusFileSize
new806 bytes
perignon’s picture

Awesome! Thanks for the patch.

perignon’s picture

Patch is incorrectly generated. You created this patch within a site instead of the module repo.

  • Perignon committed 62d33be on 8.x-1.x
    Issue #2984307 by mr.les, Perignon: Sendgrid Maillog printing debug...
perignon’s picture

Status: Active » Fixed

I fixed the issue without the patch since it was small.

Status: Fixed » Closed (fixed)

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