[solved] Forwarding news module posts to an email address
Posted: Mon May 14, 2012 11:09 am
Is it possible to get the news module to automically forward a new post to an email address, possibly in html format?
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
$gCms = cmsms(); //global $gCms;
$editedby = $gCms->variables['username'];
$bodytext = 'start of the text.<br /><br>On ' . date('l j F Y', $params['start_time']) . ' a new message was posted on www.yourwebsite.com.<br><br><hr>
<h2> ' . $params['title'] . '</h2>
<br />' . $params['summary'] . '<br /><br />
'. $params['content'].'<br clear="right"><br>';
$cmsmailer =& cms_utils::get_module('CMSMailer');
$cmsmailer->SetFrom('sending emailaddress');
$cmsmailer->SetFromName('name sending emailaddress');
$cmsmailer->AddAddress('destination emailaddress', $name='name destination emailaddress');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(true);
$cmsmailer->SetSubject('titel of email ');
$cmsmailer->Send();