Hi. I noticed when using this module with SMTP and MIMEmail modules that I got errors when it tried to send. On closer inspection it was because the mail body is prepared as a string instead of an array. This was causing a fatal error with the SMTP mailer module.
This is the problem:
$params['body'] = theme('commerce_abandoned_carts_email', array(
This is the fix:
$params['body'][] = theme('commerce_abandoned_carts_email', array(
Comments
Comment #2
3cwebdev commentedHi. I triggered some test emails with the module as it is now and the messages were received as expected with the body intact. I then changed $params['body'] to add an array key [] as you suggested and my test email body is now empty.
There must be something in your site setup that conflicting in some way and causing the issue.
Comment #3
very_random_man commentedHi. Which mailsystem are you using? We're not doing anything particularly weird although we are using the mimemail and SMTP modules. I think if you test with the SMTP mailsystem you'll see the error.
I think you must agree that $params['body'] is being set to a string value? The docs state that it should be an array.
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
This is a snippet from the SMTP module which is where the error occurs if the message body isn't an array:
Currently I have fixed this by adding this code to hook_commerce_abandoned_carts_mail_data_alter()
Comment #5
3cwebdev commented@Comment #3very_random_man, thank you for the information. I finally had some time today to look into this a bit more. I restructured some of the code and was able to get it to work with my mail system (Mandrill) while setting $params['body'] as an array.
Please test the DEV version to confirm it now works as expected for you. If so, I'll commit to a new release.