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 1347 posts 1608 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 11258 posts 23500 karma points MVP 7x 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 1347 posts 1608 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?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies