]> git.mxchange.org Git - friendica.git/commitdiff
send email confirming pending registration #2916
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 18 Nov 2016 19:16:22 +0000 (20:16 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Fri, 18 Nov 2016 19:16:22 +0000 (20:16 +0100)
include/user.php
mod/register.php

index 3997a8a61f12584da6469808d767fb93c53c2db6..a3cd27e6cefe93afaf639171231aadba85b94ede 100644 (file)
@@ -378,6 +378,28 @@ function create_user($arr) {
 }
 
 
+/**
+ * @brief send registration confiƕmation with the intormation that reg is pending
+ *
+ * @param string $email
+ * @param string $sitename
+ * @param string $username
+ */
+function send_register_pending_eml($email, $sitename, $username) {
+       $body = deindent(t('
+               Dear %1$s,
+                       Thank you for registering at %2$s. Your account is pending for approval by the administrator.
+       '));
+
+       $body = sprintf($body, $username, $sitename);
+
+       return notification(array(
+               'type' => "SYSTEM_EMAIL",
+               'to_email' => $email,
+               'subject'=> sprintf( t('Registration at %s'), $sitename),
+               'body' => $body));
+}
+
 /*
  * send registration confirmation.
  * It's here as a function because the mail is sent
index 3e124bd5bf0e0e5a0944e2466d9006a2cf958559..42127ce81c4872ee7afffb1f1f45e1d072ad1af0 100644 (file)
@@ -133,6 +133,7 @@ function register_post(&$a) {
                        $admin_mail_list
                );
 
+               // send notification to admins
                foreach ($adminlist as $admin) {
                        notification(array(
                                'type' => NOTIFY_SYSTEM,
@@ -149,6 +150,11 @@ function register_post(&$a) {
                                'show_in_notification_page' => false
                        ));
                }
+               // send notification to the user, that the registration is pending
+               send_register_pending_eml(
+                               $user['email'],
+                               $a->config['sitename'],
+                               $user['username']);
 
                info( t('Your registration is pending approval by the site owner.') . EOL ) ;
                goaway(z_root());