Email notification on new article

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Email notification on new article

Postby hansi999 » Mon Jul 30, 2012 3:42 pm

Hello,

is the a way to make pivotx send an notification email, when a new article is posted? This is possible for new comments only.

Thanks in advance.

Hansi
hansi999
 
Posts: 7
Joined: Mon Jul 30, 2012 3:36 pm

Re: Email notification on new article

Postby Harm10 » Mon Jul 30, 2012 4:47 pm

I guess you don't mean a notification for the users who already commented? Because they can specify it when they are entering their comment.

In the weblog definitions you can set a mail address to sent a notification for every new comment. Would that help?
Quality is in the detail of things............
Harm10
Developer
 
Posts: 1601
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Email notification on new article

Postby hansi999 » Mon Jul 30, 2012 5:12 pm

Exactly, i don't mean comment notification. I would like to be informed via email if a new article is posted.

I build a workaround using rsstail on my linux server, which is sending me an email.

I am just asking myself if there is an easier way to do this.
hansi999
 
Posts: 7
Joined: Mon Jul 30, 2012 3:36 pm

Re: Email notification on new article

Postby Harm10 » Mon Jul 30, 2012 6:13 pm

I don't think that is standard in PivotX. If the article published is an entry and there is a RSS feed you could get an update from there.
Quality is in the detail of things............
Harm10
Developer
 
Posts: 1601
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Email notification on new article

Postby hansi999 » Mon Jul 30, 2012 6:17 pm

Ok, thanks, so i'll stick with my notification script.
hansi999
 
Posts: 7
Joined: Mon Jul 30, 2012 3:36 pm

Re: Email notification on new article

Postby hansfn » Tue Jul 31, 2012 8:43 am

Take a look at the Execute an Extension at posting forum thread. Maybe it's better than your notification script - or maybe not.
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Email notification on new article

Postby hansi999 » Wed Aug 01, 2012 3:31 pm

Thanks a lot! Exaclty what i searched for & I got it working.

But how do i exaclty know if an entry is created or updated? $entry['code'] gives me just the index of the entry, i think.
The code is from the example:

Code: Select all
if ($entry['code']==">") {
        $text .= "created";
    } else {
        $text .= "updated";
    }
hansi999
 
Posts: 7
Joined: Mon Jul 30, 2012 3:36 pm

Re: Email notification on new article

Postby hansfn » Thu Aug 02, 2012 9:22 am

If you use flatfile database, that code is correct - a new entry has code set to ">". For MySQL database, you might need to check the date or something else. To get an idea about what to you can check, just insert

Code: Select all
debug_printr($entry);

in the function and compare the output when creating and updating an entry. (You must turn on PivotX debugging.)
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Email notification on new article

Postby hansi999 » Thu Aug 02, 2012 10:01 am

I'm using flatfile database, but a new entry has not the code set to ">", it is the number of the entry.

If I look at the debug output I also just get the number [code] => 16 of the entry, like it should be when using MySQL.

I'd like to have an esay way to distiguish between updated and new entries, is there a way to get the totalnumber of entries, so i could compare this?

Thanks in advance.
hansi999
 
Posts: 7
Joined: Mon Jul 30, 2012 3:36 pm

Re: Email notification on new article

Postby Harm10 » Thu Aug 02, 2012 10:15 am

How about comparing $entry.date / $entry.publish_date / $entry.edit_date ?
Unpublishing and publishing again will give peculiar results but you have an indication looking at these data.
Quality is in the detail of things............
Harm10
Developer
 
Posts: 1601
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Next

Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 2 guests