Hello.

Currently in my environment with mailsystem 3.x-dev and mimemail and smtp, views_send throws the following errors after running cron (of course, after mail has been spooled :P):

Notice: Undefined index: module in MailsystemDelegateMailSystem->mail() (line 37 of .../mailsystem/MailsystemDelegateMailSystem.inc).
Notice: Undefined index: key in MailsystemDelegateMailSystem->mail() (line 38 of .../mailsystem/MailsystemDelegateMailSystem.inc).
Notice: Undefined index: id in SmtpMailSystem->mailWithoutQueue() (line 63 of .../smtp/smtp.mail.inc).

It seems to have something to do with the fact that views_send_deliver() is building the message from scratch, wiping the 'module' and 'key' indices in the process, which the 3.x branch of mailsystem expects to see.

I see errors only when spooling, and I see no errors on the immediate execution, but that might be because it gets suppressed - the code looks like the error should be thrown in both cases.

Thanks!

Comments

captainack created an issue. See original summary.

captainack’s picture

Issue summary: View changes

Yup. As I suspected, the problem does exist in both modes. I see the errors in my syslog.

hansfn’s picture

Title: Throws error after cron run (mailsystem) » Mailsystem 3.x-dev requires "key" and "module" keys in the mail message

Yes, Views Send doesn't keep all the fields in the mail/array generated by drupal_mail because it supports spooling the message - there is a table, with a fixed set of fields, where the messages are spooled/saved. The fixed set of fields was probably a bad design decision (long time ago). I have committed a fix/work-around for this issue. Please test it.

  • hansfn committed 9d536c9 on 7.x-1.x
    Issue #2693393: Mailsystem 3.x-dev requires "key" and "module" keys in...
hansfn’s picture

Status: Active » Fixed
captainack’s picture

You're fast! :)

Thanks Hans!

hansfn’s picture

Status: Fixed » Closed (fixed)

I assume this means that the fixed was sufficient. Will create a new release today.

captainack’s picture

Haha. No, I hadn't had a chance to test it yet, but I just finally did. And yes, it fixed it :).

Thanks again!