]> git.mxchange.org Git - friendica.git/commitdiff
fix email to new registerd users.
authorfabrixxm <fabrix.xm@gmail.com>
Sun, 7 Sep 2014 15:46:31 +0000 (17:46 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Sun, 7 Sep 2014 15:46:31 +0000 (17:46 +0200)
fix notification in case of error sending email.

include/Emailer.php
include/enotify.php
include/user.php
mod/register.php

index 2baa279802bc28eee537e7bc74211f194f7c93a3..535a0542893dc3b88dcceda64551264295b41ca0 100644 (file)
@@ -57,6 +57,7 @@ class Emailer {
                );
                logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
                logger("return value " . (($res)?"true":"false"), LOGGER_DEBUG);
+               return $res;
        }
 }
 ?>
index 9ca9d79703cde42b32f73e4bfbb5ade232afc21d..bad94597aa6a5cb8fcaa491b5964483a118ce570 100644 (file)
@@ -595,7 +595,7 @@ function notification($params) {
 
                // use the Emailer class to send the message
 
-               Emailer::send(array(
+               return Emailer::send(array(
                        'fromName' => $sender_name,
                        'fromEmail' => $sender_email,
                        'replyTo' => $sender_email,
@@ -605,7 +605,6 @@ function notification($params) {
                        'textVersion' => $email_text_body,
                        'additionalMailHeader' => $datarray['headers'],
                ));
-        return True;
        }
 
     return False;
index bf29daf1a649e371418b08487f018187aa7efab1..eccfa7a08a69eead63ae65d62d531dc48cb5d8d7 100644 (file)
@@ -382,7 +382,7 @@ function send_register_open_eml($email, $sitename, $siteurl, $username, $passwor
                The login details are as follows:
                        Site Location:  %3$s
                        Login Name:     %1$s
-                       Password:       %5$
+                       Password:       %5$s
 
                You may change your password from your account "Settings" page after logging
                in.
@@ -407,7 +407,7 @@ function send_register_open_eml($email, $sitename, $siteurl, $username, $passwor
                $preamble = sprintf($preamble, $username, $sitename);
                $body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
 
-               notification(array(
+               return notification(array(
                        'type' => "SYSTEM_EMAIL",
                        'to_email' => $email,
                        'subject'=> sprintf( t('Registration details for %s'), $sitename),
index eb6fda737fc69cf22e8216e9ac8e9a3643658671..4ad84ecd6f872c01da1a6d0ae6b69ba80346c9a5 100644 (file)
@@ -81,20 +81,25 @@ function register_post(&$a) {
                        set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
                }
 
-               send_register_open_eml(
+               $res = send_register_open_eml(
                        $user['email'],
                        $a->config['sitename'],
                        $a->get_baseurl(),
                        $user['username'],
                        $result['password']);
 
-
                if($res) {
                        info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
                        goaway(z_root());
                }
                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) {