Ejemplo n.º 1
0
 private function sendMail($data, $subject, $content)
 {
     $find = array('firstname', 'lastname', 'name', 'url');
     foreach ($find as $key) {
         $subject = str_replace('{' . $key . '}', isset($data[$key]) ? $data[$key] : $key . ' is not set', $subject);
         $content = str_replace('{' . $key . '}', isset($data[$key]) ? $data[$key] : $key . ' is not set', $content);
     }
     Sumo\Mail::setTo($data['email']);
     Sumo\Mail::setSubject($subject);
     Sumo\Mail::setHTML($content);
     $text = strip_tags($content);
     $text = substr($text, 0, 128);
     Sumo\Mail::setText($text);
     return Sumo\Mail::send();
 }