Forum Moderators: coopster
class Mailer
{
var $mConfig;
/**
* Initialize class constructor
*/
function Mailer()
{
}
/**
* Send email to recepient
*/
function sendEmail($aEmail, $aSubject, $aBody, $aFrom, $aReplyto)
{
return mail($aEmail, $aSubject, $aBody, "From: {$aFrom}\r\n"."Reply-To: {$aReplyto}\r\n");
}
/**
* Sends email when editor action happens
*/
function sendAffMail($aAction, $aEditor)
{
$subject = $this->mConfig["{$aAction}_subject"];
$body = $this->mConfig["{$aAction}_body"];
$subject = str_replace('{own_site}', $this->mConfig['site'], $subject);
$body = str_replace('{editor_username}', $aEditor['username'], $body);
$body = str_replace('{editor_pwd}', $aEditor['password2'], $body);
$body = str_replace('{own_site}', $this->mConfig['site'], $body);
$body = str_replace('{own_url}', $this->mConfig['base'], $body);
$body = str_replace('{own_email}', $this->mConfig['site_email'], $body);
$body = stripslashes($body);
return $this->sendEmail($aEditor['email'], $subject, $body, $this->mConfig['site_email'], $this->mConfig['site_email']);
}
}
?>