1 | <?php |
||
3 | class EmailSettings extends CiiSettingsModel |
||
|
|||
4 | { |
||
5 | protected $SMTPHost = NULL; |
||
6 | |||
7 | protected $SMTPPort = NULL; |
||
8 | |||
9 | protected $SMTPUser = NULL; |
||
10 | |||
11 | protected $SMTPPass = NULL; |
||
12 | |||
13 | protected $notifyName = NULL; |
||
14 | |||
15 | protected $notifyEmail = NULL; |
||
16 | |||
17 | protected $useTLS = 0; |
||
18 | |||
19 | protected $useSSL = 0; |
||
20 | |||
21 | public function rules() |
||
31 | |||
32 | public function attributeLabels() |
||
45 | |||
46 | /** |
||
47 | * Generic method for sending an email. Instead of having to call a bunch of code all over over the place |
||
48 | * This method can be called which should be able to handle almost anything. |
||
49 | * |
||
50 | * By calling this method, the SMTP details will automatically be setup as well the notify email and user |
||
51 | * |
||
52 | * @param Users $user The User we are sending the email to |
||
53 | * @param string $subject The email Subject |
||
54 | * @param string $viewFile The view file we want to render. Generally this should be in the form //email/<file> |
||
55 | * And should correspond to a viewfile in /themes/<theme>/views/email/<file> |
||
56 | * @param array $content The content to pass to renderPartial() |
||
57 | * @param boolean $return Whether the output should be returned. The default is TRUE since this output will be passed to MsgHTML |
||
58 | * @param boolean $processOutput Whether the output should be processed. The default is TRUE since this output will be passed to MsgHTML |
||
59 | * @return boolean Whether or not the email sent sucessfully |
||
60 | */ |
||
61 | public function send($user, $subject = "", $viewFile, $content = array(), $return = true, $processOutput = true, $debug=false) |
||
112 | |||
113 | /** |
||
114 | * Generates a user object |
||
115 | * @param array $userData |
||
116 | */ |
||
117 | private function getNotifyUser($userData=array()) |
||
138 | |||
139 | /** |
||
140 | * Renders a view file. |
||
141 | * |
||
142 | * @param string $viewFile view file path |
||
143 | * @param array $data data to be extracted and made available to the view |
||
144 | * @param boolean $return whether the rendering result should be returned instead of being echoed |
||
145 | * @return string the rendering result. Null if the rendering result is not required. |
||
146 | * @throws CException if the view file does not exist |
||
147 | */ |
||
148 | private function renderFile($viewFile,$data=null,$return=false) |
||
157 | |||
158 | /** |
||
159 | * Renders a view file. |
||
160 | * This method includes the view file as a PHP script |
||
161 | * and captures the display result if required. |
||
162 | * @param string $_viewFile_ view file |
||
163 | * @param array $_data_ data to be extracted and made available to the view file |
||
164 | * @param boolean $_return_ whether the rendering result should be returned as a string |
||
165 | * @return string the rendering result. Null if the rendering result is not required. |
||
166 | */ |
||
167 | private function renderInternal($_viewFile_,$_data_=null,$_return_=false) |
||
184 | } |
||
185 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.