function _user_import_send_email in User Import 5.2
Same name and namespace in other branches
- 8 supported/user_import.inc \_user_import_send_email()
- 5 supported/user_import.inc \_user_import_send_email()
- 6.4 supported/user_import.inc \_user_import_send_email()
- 6.2 supported/user_import.inc \_user_import_send_email()
- 7.3 supported/user_import.inc \_user_import_send_email()
- 7 supported/user_import.inc \_user_import_send_email()
- 7.2 supported/user_import.inc \_user_import_send_email()
2 calls to _user_import_send_email()
- og_user_import_group_add in supported/
og.inc - user_import_user_import_after_save in supported/
user_import.inc - Implementation of hook_user_import_after_save().
File
- supported/
user_import.inc, line 29
Code
function _user_import_send_email($account, $password, $profile, $subject, $body, $format, $css, $subscribed) {
global $base_url;
$from = variable_get('site_mail', ini_get('sendmail_from'));
$variables = array(
'!username' => $account->name,
'!uid' => $account->uid,
'!site' => variable_get('site_name', 'drupal'),
'!login_url' => user_pass_reset_url($account),
'!password' => $password,
'!uri' => $base_url,
'!uri_brief' => drupal_substr($base_url, drupal_strlen('http://')),
'!mailto' => $account->mail,
'!date' => format_date(time()),
'!login_uri' => url('user', NULL, NULL, TRUE),
'!edit_uri' => url('user/' . $account->uid . '/edit', NULL, NULL, TRUE),
);
_user_import_publication_email($variables, $account, $subscribed, $format);
// import info to profile
if (module_exists('profile') && is_array($profile)) {
$profile_name = _user_import_profile('fid', 'name');
while (list($fid, $field_name) = each($profile_name)) {
$variables['!' . $field_name] = $profile[$fid];
}
}
$subject = empty($subject) ? _user_mail_text('welcome_subject', $variables) : strtr($subject, $variables);
$subject = mime_header_encode($subject);
$body = empty($body) ? _user_mail_text('welcome_body', $variables) : strtr($body, $variables);
$body = str_replace("\r", '', $body);
$header = "From: {$from}\n";
$header .= "Reply-to: {$from}\n";
$header .= "X-Mailer: Drupal\n";
$header .= "Return-path: {$from}\n";
$header .= "Errors-to: {$from}\n";
$header .= 'MIME-Version: 1.0';
$header .= "\n";
if ($format == 1) {
$header .= 'Content-Type: text/html; charset=UTF-8; Content-transfer-encoding: 8Bit';
$body_head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
if (!empty($css)) {
$body_head .= '<style type="text/css">' . check_plain($css) . '</style>';
}
$body = $body_head . '</head><body>' . $body . '<body></html>';
}
else {
$header .= 'Content-Type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8Bit';
}
//mail($account->mail, $subject, $body, $header);
return;
}