How to use NewsArticleAdded Event and User Defined Tags?
Posted: Wed Aug 27, 2008 1:12 pm
Hello,
My objective is to send email to a mailing list whenever a new NEWS article on published on my website.
The clue I got from you helpful people is to use the EVENTS and use a User Defined Tag.
Yes, the EVENTS work and the User Defined Tag works, but I cannot understand how to use the fields of the NewsArticleAdded event manual in the User Defined Tag.
NewsArticleAdded
Sent when an article is added.
Parameters
\"news_id\" - Id of the news article
\"category_id\" - Id of the category for this article
\"title\" - Title of the article
\"content\" - Content of the article
\"summary\" - Summary of the article
\"status\" - Status of the article ("draft" or "publish")
\"start_time\" - Date the article should start being displayed
\"end_time\" - Date the article should stop being displayed
\"useexp\" - Whether the expiration date should be ignored or not
My user defined tag has
global $gCms;
$content =& $params['content'];
$bodytext = 'News from Eurasia Motorsport Team';
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('my@emailaddress.com');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('Subject Title');
$cmsmailer->Send();
My question is how do I use the fields / variables of NewsArticleAdded in the Subject and Body Text?
I've been fiddling with this for 2 days and I can't get it right.
Help pls?
My objective is to send email to a mailing list whenever a new NEWS article on published on my website.
The clue I got from you helpful people is to use the EVENTS and use a User Defined Tag.
Yes, the EVENTS work and the User Defined Tag works, but I cannot understand how to use the fields of the NewsArticleAdded event manual in the User Defined Tag.
NewsArticleAdded
Sent when an article is added.
Parameters
\"news_id\" - Id of the news article
\"category_id\" - Id of the category for this article
\"title\" - Title of the article
\"content\" - Content of the article
\"summary\" - Summary of the article
\"status\" - Status of the article ("draft" or "publish")
\"start_time\" - Date the article should start being displayed
\"end_time\" - Date the article should stop being displayed
\"useexp\" - Whether the expiration date should be ignored or not
My user defined tag has
global $gCms;
$content =& $params['content'];
$bodytext = 'News from Eurasia Motorsport Team';
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('my@emailaddress.com');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('Subject Title');
$cmsmailer->Send();
My question is how do I use the fields / variables of NewsArticleAdded in the Subject and Body Text?
I've been fiddling with this for 2 days and I can't get it right.
Help pls?