diff --git a/booking.emails.inc b/booking.emails.inc index 7171c6a..148e9fe 100644 --- a/booking.emails.inc +++ b/booking.emails.inc @@ -328,12 +328,12 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') { '!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['attachment'] = $attachment; + $attachment = array( + 'filecontent' => file_get_contents(DRUPAL_ROOT . '/README.txt'), + 'filename' => 'test.txt', + 'filemime' => 'text/plain', + ); + $params['attachment'] = $attachment; } //load the node matching this id diff --git a/booking.module b/booking.module index cd443c6..32154d6 100644 --- a/booking.module +++ b/booking.module @@ -976,9 +976,9 @@ function booking_mail($key, &$message, $params) { // Add attachment when available. // From https://drupal.stackexchange.com/questions/101035/send-attachments-with-drupal-mail - //if (isset($params['attachment'])) { - // $message['params']['attachments'][] = $params['attachment']; - //} + if (isset($params['attachment'])) { + $message['params']['attachments'][] = $params['attachment']; + } //watchdog('booking_debug', "
Mail hook:\n@info
", array('@info' => print_r( $message, true))); }