Email on Page review date

Permalink
Our site is for a school website and we have a lot of pages with information that gets updated frequently and infrequently. It's apparent that keeping track of when and who needs to update this info is becoming less than ideal.

Can I add a Review Date to a page that, when a set date is reached it triggers an email that informs a group of users the page needs to be reviewed?

gavthompson
 
gavthompson replied on at Permalink Reply
gavthompson
Any thoughts?
jordif replied on at Permalink Reply
jordif
Yes, this should be possible. I haven't done anything like this, but I guess you should create a custom job.

Some information on Automated Jobs in concrete5:

http://documentation.concrete5.org/editors/dashboard/system-and-mai...

Some example of custom jobs:

https://www.concrete5.org/marketplace/addons/clear-cache1...
https://www.concrete5.org/marketplace/addons/rescan-all-files...

So I guess you could create a Page attribute to enter a review date, then have an automated job that will search all pages that have reached the review date and send an email to the appropriate group of users.

Sorry not to be more specific,

Jordi
gavthompson replied on at Permalink Reply
gavthompson
Thanks for the input Jordi, at least I have an idea of where to get started.
gavthompson replied on at Permalink Reply
gavthompson
I have created an Attribute (handle 'review') and it is attachable to the page for the user.

I'm guessing my next step would be the custom job but struggling to know what to use in the code.

Now I've been digging around and found this on a cheat sheet:
<?php
  if($date->getSystemDateTime($c->getCollectionAttributeValue('review'), $mask = 'd-m-Y G:i') > $date->getLocalDateTime('now',$mask = 'd-m-Y G:i')) {
    echo 'End date is greater than today';
  }
?>

I know it's just outputting an echo command at the moment, but do you think the values are correct to collect my review attribute from the page?
jordif replied on at Permalink Reply
jordif
Hi,

here is some information on getting data about a page:

http://documentation.concrete5.org/developers/working-with-pages/ge...

I think getCollectionAttributeValue() is deprecated, in concrete 5.7 you can use getAttribute().

By the way, you may want to have a look at the default jobs included in concrete5, since some of them also iterate through all pages (as you need to do):

https://github.com/concrete5/concrete5/tree/develop/concrete/jobs...

Regards,

Jordi