Exemplo n.º 1
0
function sendTemplateEmail($to, $subject_path, $body_path, $template_vars)
{
    $app_config = getConfig();
    $email_from_address = '*****@*****.**';
    include 'config.php';
    $subject_path = $app_config['document_root'] . "/" . $subject_path;
    $body_path = $app_config['document_root'] . "/" . $body_path;
    //$headers = "From:$email_from_address\n";
    $headers = "From:{$email_from_address}\n";
    $email_subject_body = getEmailTemplateBody($subject_path);
    $email_template_body = getEmailTemplateBody($body_path);
    $email_body = getEmailBody($email_template_body, $template_vars);
    $email_subject = getEmailBody($email_subject_body, $template_vars);
    #echo "$email_subject";
    #echo "$email_body";
    #echo " $to";
    mail($to, $email_subject, $email_body, $headers);
}
Exemplo n.º 2
0
 function sendTemplateEmail($to, $subject_path, $body_path, $template_vars)
 {
     //$app_config = getConfig();
     $app_config = $this->app_config;
     $email_from_address = '*****@*****.**';
     //include 'config.php';
     $subject_path = $app_config['document_root'] . "/../" . $subject_path;
     $body_path = $app_config['document_root'] . "/../" . $body_path;
     //$headers = "From:$email_from_address\n";
     $headers = "From:{$email_from_address}\n";
     $email_subject_body = getEmailTemplateBody($subject_path);
     $email_template_body = getEmailTemplateBody($body_path);
     $email_body = $this->getEmailBody($email_template_body, $template_vars);
     $email_subject = $this->getEmailBody($email_subject_body, $template_vars);
     $this->sendSMTPEmail($to, $email_subject, $email_body);
 }