From d0f8d4451682c840955646122fa1d20e92a1bc1f Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 27 Jun 2017 19:04:52 +1000 Subject: [PATCH] handle mailsystem register/cleanup better --- booking.install | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/booking.install b/booking.install index 186adda..b5b5c36 100644 --- a/booking.install +++ b/booking.install @@ -695,11 +695,9 @@ function booking_uninstall() { */ function booking_enable() { drupal_set_message($message = t('The Booking System module was successfully enabled.'), $type = 'status'); - variable_set('mail_system', array('default-system' => 'DefaultMailSystem', 'booking' => 'BookingMailSystem')); - //let MIME Mail know that we can send html emails - mailsystem_set(array( - 'booking' => 'BookingMailSystem', - )); + $current = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); + $addition = array('booking' => 'BookingMailSystem'); + variable_set('mail_system', array_merge($current, $addition)); } /** @@ -707,11 +705,9 @@ function booking_enable() { */ function booking_disable() { drupal_set_message($message = t('The Booking System module was successfully disabled.'), $type = 'status'); - variable_set('mail_system', array('default-system' => 'DefaultMailSystem')); - //clean up our entry about mailsystems - mailsystem_clear(array( - 'booking' => 'BookingMailSystem', - )); + $mail_system = variable_get('mail_system', array('default-system' => 'DefaultMailSystem')); + unset($mail_system['booking']); + variable_set('mail_system', $mail_system); } /**