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