1
|
|
|
<?php |
2
|
|
|
namespace GJClasses; |
3
|
|
|
|
4
|
|
|
class Notify |
5
|
|
|
{ |
6
|
|
|
public function __construct($method, $name, $address, $reply_name, $reply_address, $recipients, $email_subject, |
7
|
|
|
$html, $text, $push_provider, $api_key, $user_key, $push_subject, $content, $url, |
8
|
|
|
$priority) |
9
|
|
|
{ |
10
|
|
|
if ($method == 'all') { |
11
|
|
|
|
12
|
|
|
$mail = new Mail(); |
13
|
|
|
$mail->send($name, $address, $reply_name, $reply_address, $recipients, $email_subject, $html, $text); |
14
|
|
|
|
15
|
|
|
$push = new Push($push_provider); |
16
|
|
|
$push->push($api_key, $user_key, $push_subject, $content, $url, $priority); |
17
|
|
|
|
18
|
|
|
} elseif ($method == 'email') { |
19
|
|
|
|
20
|
|
|
$mail = new Mail(); |
21
|
|
|
$mail->send($name, $address, $reply_name, $reply_address, $recipients, $email_subject, $html, $text); |
22
|
|
|
|
23
|
|
|
} elseif ($method == 'push') { |
24
|
|
|
|
25
|
|
|
$push = new Push($push_provider); |
26
|
|
|
$push->push($api_key, $user_key, $push_subject, $content, $url, $priority); |
27
|
|
|
|
28
|
|
|
} |
29
|
|
|
} |
30
|
|
|
} |
31
|
|
|
|