Commit 0340a249 authored by mig5's avatar mig5 Committed by mig5

580264 fix sending of blank e-mails, regressive issue from d5 backport maybe

parent be84d616
......@@ -97,6 +97,40 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment