Failed Conditions
Push — psr2 ( 749c00...b8c09b )
by Andreas
06:25 queued 06:21
created

RegistrationSubscriptionSender::sendRegister()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

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