xref: /dokuwiki/inc/Subscriptions/RegistrationSubscriptionSender.php (revision 479c05b1f975e52558d9ff3234097c0c5c405d27)
1*479c05b1SMichael Große<?php
2*479c05b1SMichael Große
3*479c05b1SMichael Großenamespace dokuwiki\Subscriptions;
4*479c05b1SMichael Große
5*479c05b1SMichael Großeclass RegistrationSubscriptionSender extends SubscriptionSender
6*479c05b1SMichael Große{
7*479c05b1SMichael Große
8*479c05b1SMichael Große    /**
9*479c05b1SMichael Große     * Send a notify mail on new registration
10*479c05b1SMichael Große     *
11*479c05b1SMichael Große     * @author Andreas Gohr <andi@splitbrain.org>
12*479c05b1SMichael Große     *
13*479c05b1SMichael Große     * @param string $login    login name of the new user
14*479c05b1SMichael Große     * @param string $fullname full name of the new user
15*479c05b1SMichael Große     * @param string $email    email address of the new user
16*479c05b1SMichael Große     * @return bool true if a mail was sent
17*479c05b1SMichael Große     */
18*479c05b1SMichael Große    public function sendRegister($login, $fullname, $email) {
19*479c05b1SMichael Große        global $conf;
20*479c05b1SMichael Große        if(empty($conf['registernotify'])) return false;
21*479c05b1SMichael Große
22*479c05b1SMichael Große        $trep = array(
23*479c05b1SMichael Große            'NEWUSER' => $login,
24*479c05b1SMichael Große            'NEWNAME' => $fullname,
25*479c05b1SMichael Große            'NEWEMAIL' => $email,
26*479c05b1SMichael Große        );
27*479c05b1SMichael Große
28*479c05b1SMichael Große        return $this->send(
29*479c05b1SMichael Große            $conf['registernotify'],
30*479c05b1SMichael Große            'new_user',
31*479c05b1SMichael Große            $login,
32*479c05b1SMichael Große            'registermail',
33*479c05b1SMichael Große            $trep
34*479c05b1SMichael Große        );
35*479c05b1SMichael Große    }
36*479c05b1SMichael Große}
37