Index: install_6.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal/install_6.inc,v retrieving revision 1.16 diff -u -p -r1.16 install_6.inc --- install_6.inc 11 Sep 2009 20:34:03 -0000 1.16 +++ install_6.inc 20 Sep 2009 03:43:54 -0000 @@ -97,6 +97,40 @@ function install_send_welcome_mail($url, drush_log(t('Login url: !onetime', array('!onetime' => $onetime)), 'message'); } +function install_mail($key, &$message, $params) { + switch ($key) { + case 'welcome-admin': + // allow the profile to override welcome email text + if (file_exists("./profiles/$profile/provision_welcome_mail.inc")) { + require_once "./profiles/$profile/provision_welcome_mail.inc"; + $custom = TRUE; + } + elseif (file_exists(dirname(__FILE__) . '/../provision_welcome_mail.inc')) { + /** use the module provided welcome email + * We can not use drupal_get_path here, + * as we are connected to the provisioned site's database + */ + require_once dirname(__FILE__) . '/../provision_welcome_mail.inc'; + $custom = TRUE; + } + else { + // last resort use the user-pass mail text + $custom = FALSE; + } + + if ($custom) { + $message['subject'] = st($mail['subject'], $params['variables']); + $message['body'] = st($mail['body'], $params['variables']); + } + else { + $message['subject'] = _user_mail_text('pass_subject', $params['variables']); + $message['body'] = _user_mail_text('pass_body', $params['variables']); + } + + break; + } +} + function install_main() { require_once './includes/bootstrap.inc'; drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION);