I need to write a routine that looks for nodes that have an unpublish date within a set period (e.g. 14 days from run date). I am assuming it will be called by Windows Scheduler.
Could this be done as a controller, based on UmbracoApiController? It doesn't need to return anything, it just needs to find nodes and send emails to the required people.
Creating it as a standalone console app seemed like a good idea, until I thought about trying to get an Umbraco context!?
The problem I am now having is finding the node's unpublish (expireDate?) date. It doesn't appear to be in the cache, so I assume I need to use the "ContentService".
Alternatively, maybe I could add expireDate to an Examine index and do a query?
Best way to process nodes from scheduled task
I need to write a routine that looks for nodes that have an unpublish date within a set period (e.g. 14 days from run date). I am assuming it will be called by Windows Scheduler.
Could this be done as a controller, based on UmbracoApiController? It doesn't need to return anything, it just needs to find nodes and send emails to the required people.
Creating it as a standalone console app seemed like a good idea, until I thought about trying to get an Umbraco context!?
Hi Gordon
I think that you should be able to create a service for this using the content service API to look for those unpulished nodes - Have you had a look at the API here https://our.umbraco.org/Documentation/Reference/Management-v6/Services/ContentService ?
/Jan
Yes, that is the approach I have taken.
The problem I am now having is finding the node's unpublish (expireDate?) date. It doesn't appear to be in the cache, so I assume I need to use the "ContentService".
Alternatively, maybe I could add expireDate to an Examine index and do a query?
is working on a reply...