Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1461 posts 1883 karma points
    Jul 21, 2015 @ 13:19
    Gordon Saxby
    0

    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!?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 21, 2015 @ 18:40
    Jan Skovgaard
    0

    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

  • Gordon Saxby 1461 posts 1883 karma points
    Jul 22, 2015 @ 08:05
    Gordon Saxby
    0

    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?

Please Sign in or register to post replies

Write your reply to:

Draft