Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I get a
Notice: Undefined index: key in SWIFTMailSystem->mail() (line 223 of /srv/www/htdocs/sites/all/modules/swiftmailer/includes/classes/SWIFTMailSystem.inc).
error when i use swiftmailer together with views send.
The error seems to be caused by $message['key'] not being present. Adding an additional isset test around the code block supresses the error notice (like:
if (isset($message['key'])) {
$files = module_invoke_all('swiftmailer_attach', $message['key']);
if (!empty($files) && is_array($files)) {
$message['params']['files'] = array_merge(array_values($message['params']['files']), array_values($files));
}
}
Comment | File | Size | Author |
---|---|---|---|
#3 | 2666416-undefined-index.patch | 1.07 KB | sbrattla |
Comments
Comment #2
wvd_vegt CreditAttribution: wvd_vegt as a volunteer commentedComment #3
sbrattla CreditAttribution: sbrattla as a volunteer commentedAdding patch for this issue.
Comment #4
bhavikshah9 CreditAttribution: bhavikshah9 at Tatvasoft commented