Benachrichtigung bei neuen News

Hilfe zu Modulen und Tags
Post Reply
Stoffel84
Forum Members
Forum Members
Posts: 69
Joined: Sun Apr 09, 2006 3:33 pm

Benachrichtigung bei neuen News

Post by Stoffel84 »

Hi,

hier wurde vorgestellt, wie man per UDT eine Benachrichtung nach dem Ändern einer Seite erhält:
Send Email Notification on Page Change

This is a UDT/Event combination that sends an email when a page is changed. This example uses the CMSMailer module (recommended).

First, create the following UDT named send_email_notification (or whatever name you want). Be sure to change the email address.

global $gCms;
$content =& $params['content'];

$editedby = $gCms->variables['username'];

$bodytext = '
A page on the web site has been changed.

Page Name: '.$content->Name().'
Page Alias: '.$content->Alias().'
Page Type: '.$content->Type().'
Page Created: '.$content->GetCreationDate().'
Modified on: '.$content->GetModifiedDate().'
Modified by: '.$editedby.'
Page URL: '.$content->GetURL();

$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('your@email.com');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('Page change notification--' .$content->Name());
$cmsmailer->Send();

Next, go to Extensions->Events, click the edit button for ContentEditPost, find your new UDT in the dropdown list, and ADD it.

That's it, good luck!

Wie passe ich das auf einen News Artikel an? Die Parameterübergabe der Category würde mir eigentlich schon reichen.

Danke und Gruß

Stoffel
cyberman

Re: Benachrichtigung bei neuen News

Post by cyberman »

Die Kategorie wird nicht übergeben, nur die Kategorie-ID.

Schau mal in die Hilfe der Ereignisverwaltung (Stichwort NewsArticleAdded).
Stoffel84
Forum Members
Forum Members
Posts: 69
Joined: Sun Apr 09, 2006 3:33 pm

Re: Benachrichtigung bei neuen News

Post by Stoffel84 »

Also manchmal hab ich echt Tomaten auf den Augen... Dank dir.
Post Reply

Return to “Module und Tags”