Beispiel #1
0
function ew_SendTemplateEmail($sTemplate, $sSender, $sRecipient, $sCcEmail, $sBccEmail, $sSubject, $arContent)
{
    if ($sSender != "" && $sRecipient != "") {
        $Email = new cEmail();
        $Email->Load($sTemplate);
        $Email->ReplaceSender($sSender);
        // Replace Sender
        $Email->ReplaceRecipient($sRecipient);
        // Replace Recipient
        if ($sCcEmail != "") {
            $Email->AddCc($sCcEmail);
        }
        // Add Cc
        if ($sBccEmail != "") {
            $Email->AddBcc($sBccEmail);
        }
        // Add Bcc
        if ($sSubject != "") {
            $Email->ReplaceSubject($sSubject);
        }
        // Replace subject
        if (is_array($arContent)) {
            foreach ($arContent as $key => $value) {
                $Email->ReplaceContent($key, $value);
            }
        }
        return $Email->Send();
    }
    return FALSE;
}
Beispiel #2
0
function ew_SendNotifyEmail($sFn, $sSubject, $sTable, $sKey, $sAction)
{
    // Send Email
    if (EW_SENDER_EMAIL != "" && EW_RECIPIENT_EMAIL != "") {
        $Email = new cEmail();
        $Email->Load($sFn);
        $Email->ReplaceSender(EW_SENDER_EMAIL);
        // Replace Sender
        $Email->ReplaceRecipient(EW_RECIPIENT_EMAIL);
        // Replace Recipient
        $Email->ReplaceSubject($sSubject);
        // Replace Subject
        $Email->ReplaceContent("<!--table-->", $sTable);
        $Email->ReplaceContent("<!--key-->", $sKey);
        $Email->ReplaceContent("<!--action-->", $sAction);
        $Email->Send();
    }
}