Failed Conditions
Push — refactorSubscriptions ( 74035a...75d664 )
by Michael
03:07
created

RegistrationSubscriptionSender   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A sendRegister() 0 21 2
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