fix email to new registerd users.
fix notification in case of error sending email.
This commit is contained in:
parent
6db73c0b6d
commit
3ac5e4508b
4 changed files with 12 additions and 7 deletions
|
@ -57,6 +57,7 @@ class Emailer {
|
||||||
);
|
);
|
||||||
logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
|
logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
|
||||||
logger("return value " . (($res)?"true":"false"), LOGGER_DEBUG);
|
logger("return value " . (($res)?"true":"false"), LOGGER_DEBUG);
|
||||||
|
return $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -595,7 +595,7 @@ function notification($params) {
|
||||||
|
|
||||||
// use the Emailer class to send the message
|
// use the Emailer class to send the message
|
||||||
|
|
||||||
Emailer::send(array(
|
return Emailer::send(array(
|
||||||
'fromName' => $sender_name,
|
'fromName' => $sender_name,
|
||||||
'fromEmail' => $sender_email,
|
'fromEmail' => $sender_email,
|
||||||
'replyTo' => $sender_email,
|
'replyTo' => $sender_email,
|
||||||
|
@ -605,7 +605,6 @@ function notification($params) {
|
||||||
'textVersion' => $email_text_body,
|
'textVersion' => $email_text_body,
|
||||||
'additionalMailHeader' => $datarray['headers'],
|
'additionalMailHeader' => $datarray['headers'],
|
||||||
));
|
));
|
||||||
return True;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return False;
|
return False;
|
||||||
|
|
|
@ -382,7 +382,7 @@ function send_register_open_eml($email, $sitename, $siteurl, $username, $passwor
|
||||||
The login details are as follows:
|
The login details are as follows:
|
||||||
Site Location: %3$s
|
Site Location: %3$s
|
||||||
Login Name: %1$s
|
Login Name: %1$s
|
||||||
Password: %5$
|
Password: %5$s
|
||||||
|
|
||||||
You may change your password from your account "Settings" page after logging
|
You may change your password from your account "Settings" page after logging
|
||||||
in.
|
in.
|
||||||
|
@ -407,7 +407,7 @@ function send_register_open_eml($email, $sitename, $siteurl, $username, $passwor
|
||||||
$preamble = sprintf($preamble, $username, $sitename);
|
$preamble = sprintf($preamble, $username, $sitename);
|
||||||
$body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
|
$body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
|
||||||
|
|
||||||
notification(array(
|
return notification(array(
|
||||||
'type' => "SYSTEM_EMAIL",
|
'type' => "SYSTEM_EMAIL",
|
||||||
'to_email' => $email,
|
'to_email' => $email,
|
||||||
'subject'=> sprintf( t('Registration details for %s'), $sitename),
|
'subject'=> sprintf( t('Registration details for %s'), $sitename),
|
||||||
|
|
|
@ -81,20 +81,25 @@ function register_post(&$a) {
|
||||||
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
|
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
|
||||||
}
|
}
|
||||||
|
|
||||||
send_register_open_eml(
|
$res = send_register_open_eml(
|
||||||
$user['email'],
|
$user['email'],
|
||||||
$a->config['sitename'],
|
$a->config['sitename'],
|
||||||
$a->get_baseurl(),
|
$a->get_baseurl(),
|
||||||
$user['username'],
|
$user['username'],
|
||||||
$result['password']);
|
$result['password']);
|
||||||
|
|
||||||
|
|
||||||
if($res) {
|
if($res) {
|
||||||
info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
|
info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
notice( t('Failed to send email message. Here is the message that failed.') . $email_tpl . EOL );
|
notice(
|
||||||
|
sprintf(
|
||||||
|
t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.'),
|
||||||
|
$user['email'],
|
||||||
|
$result['password']
|
||||||
|
). EOL
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($a->config['register_policy'] == REGISTER_APPROVE) {
|
elseif($a->config['register_policy'] == REGISTER_APPROVE) {
|
||||||
|
|
Loading…
Reference in a new issue