diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-11-30 13:09:15 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-11-30 13:09:15 +0100 |
commit | 790b77202079261b11d425e0c814608d626eea70 (patch) | |
tree | a0ac11ba59a10a9e818508f46e6c50a2294fcb77 /inc/subscription.php | |
parent | 10b5c32d6486ab0884deda109b1e5947f7ec7662 (diff) | |
download | rpg-790b77202079261b11d425e0c814608d626eea70.tar.gz rpg-790b77202079261b11d425e0c814608d626eea70.tar.bz2 |
moved registration notification to subscription class
Diffstat (limited to 'inc/subscription.php')
-rw-r--r-- | inc/subscription.php | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/inc/subscription.php b/inc/subscription.php index 4757b216c..bfbd95244 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -429,9 +429,18 @@ class Subscription { ); } + /** + * Send a notify mail on new registration + * + * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $login login name of the new user + * @param string $fullname full name of the new user + * @param string $email email address of the new user + * @return bool true if a mail was sent + */ public function send_register($login, $fullname, $email) { global $conf; - global $ID; if(empty($conf['registernotify'])) return false; $trep = array( @@ -443,7 +452,7 @@ class Subscription { return $this->send( $conf['registernotify'], 'new_user', - $ID, + $login, 'registermail', $trep ); @@ -486,10 +495,10 @@ class Subscription { * @param string $subscriber_mail The target mail address * @param array $ids Array of ids * @param string $ns_id The id of the namespace - * @return bool + * @return bool true if a mail was sent */ protected function send_list($subscriber_mail, $ids, $ns_id) { - if(count($ids) === 0) return; + if(count($ids) === 0) return false; $tlist = ''; $hlist = '<ul>'; @@ -526,7 +535,7 @@ class Subscription { * @param string $subscriber_mail The target mail address * @param string $subject The lang id of the mail subject (without the * prefix “mail_”) - * @param string $id The page or namespace id + * @param string $context The context of this mail, eg. page or namespace id * @param string $template The name of the mail template * @param array $trep Predefined parameters used to parse the * template (in text format) @@ -534,17 +543,11 @@ class Subscription { * template (in HTML format), null to default to $trep * @return bool */ - protected function send($subscriber_mail, $subject, $id, $template, $trep, $hrep = null) { + protected function send($subscriber_mail, $subject, $context, $template, $trep, $hrep = null) { global $lang; $text = rawLocale($template); - $trep = array_merge( - $trep, array( - - ) - ); - - $subject = $lang['mail_'.$subject].' '.$id; + $subject = $lang['mail_'.$subject].' '.$context; $mail = new Mailer(); $mail->bcc($subscriber_mail); $mail->subject($subject); |