test email attachments

This commit is contained in:
Nathan Coad
2018-06-16 17:47:49 +10:00
parent 855c114b2b
commit 0e35a832c1
3 changed files with 18 additions and 8 deletions

View File

@@ -325,7 +325,14 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') {
//calculate the from email address for a logistics email
$from = t('!event Registrations <!email>', array('!event' => $event->booking_eventname,
'!email' => variable_get('booking_logistics_email', variable_get('site_mail', ini_get('sendmail_from')))
));
));
// Test email attachments with dummy file
$attachment = array(
'filecontent' => file_get_contents(DRUPAL_ROOT . '/README.txt'),
'filename' => 'test.txt',
'filemime' => 'text/plain',
);
$params['attachments'][] = $attachment;
}
//load the node matching this id