function sendEmailFromTemplate($templateName, $user, $data = null)
{
    $message = createEmailFromTemplate($templateName, $user, $data);
    return sendEmail($message);
}
Exemple #2
0
<?php

require_once "../include/includes.php";
//setContentType("text","plain");
$template = getParam("template", "signup");
$send = getParamBoolean("send");
$to = reqParam("to");
//$to = "*****@*****.**";
$message = createEmailFromTemplate($template, $to);
$email_config = getConfig("_email");
echoJsVar("email_config");
$sentDate = date("Y-m-d H:i:s");
echo "Sent: {$sentDate}<br/>";
$sentDate = md5($sentDate);
echo "MD5: {$sentDate}<br/>";
echo "To: {$to}<br/>\n";
if ($message) {
    echo $message->getSubject() . "\n";
    echo $message->getBody();
}
if ($send) {
    $result = sendEmail($message);
    echoJsVar("result");
}