modify ready for multiple email attachments
This commit is contained in:
@@ -303,7 +303,7 @@ function _booking_partialbalance_payment_email($nid) {
|
||||
* @param $email_type - select which custom email template to use
|
||||
* @return nothing
|
||||
*/
|
||||
function _booking_custom_email($nid, $email_type, $sender = 'contact', $attachment = NULL) {
|
||||
function _booking_custom_email($nid, $email_type, $sender = 'contact', $attachments = NULL) {
|
||||
global $event;
|
||||
global $user;
|
||||
$language = user_preferred_language($user);
|
||||
@@ -352,12 +352,12 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact', $attachme
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
// If there was an attachment, then add it
|
||||
if ($attachment) {
|
||||
foreach ($attachments as $attachment) {
|
||||
$file_uri = drupal_realpath($attachment->uri);
|
||||
// Make sure we can still access the file
|
||||
if (file_exists($file_uri) && fopen($file_uri, 'r') !== false) {
|
||||
//watchdog('booking_debug', "Adding attachment !name to custom email.", array('!name' => $attachment->filename));
|
||||
$params['attachment'] = file_load($attachment->fid);
|
||||
watchdog('booking_debug', "Adding attachment !name to custom email.", array('!name' => $attachment->filename));
|
||||
$params['attachment'][] = file_load($attachment->fid);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user