Merge branch 'master' into 'dev_production'
Master
See merge request !40
Showing
| ... | ... | @@ -95,4 +95,35 @@ |
| $unique = md5(uniqid(time().mt_rand(), true)); | ||
| return $unique; | ||
| } | ||
| function getNotifTemplate(){ | ||
| $CI = & get_instance(); | ||
| $settings = $CI->db->get('notification_templates'); | ||
| return (!empty($settings))?$settings->row_array():''; | ||
| } | ||
| function send_mail($subject,$email,$message,$attach=null) { | ||
| $ci =& get_instance(); | ||
| $ci->load->library('email'); | ||
| $ci->email->initialize(array( | ||
| 'protocol' => 'smtp', | ||
| 'smtp_host' => 'smtp.sendgrid.net', | ||
| 'smtp_user' => '[email protected]', | ||
| 'smtp_pass' => 'Golden_123', | ||
| 'smtp_port' => 587, | ||
| 'crlf' => "\r\n", | ||
| 'newline' => "\r\n" | ||
| )); | ||
| $ci->email->from('[email protected]', 'DcarFixxers'); | ||
| $ci->email->to($email); | ||
| $ci->email->cc('[email protected]'); | ||
| $ci->email->subject($subject); | ||
| $ci->email->message($message); | ||
| $ci->email->set_mailtype('html'); | ||
| if($attach != null) { | ||
| $ci->email->attach($attach); | ||
| } | ||
| return $ci->email->send(); | ||
| } | ||
| ?> | ||
| \ No newline at end of file |
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment