How do I programmatically access items in the Workbox? - sitecore

How does Sitecore find these items? I want to set up a schedule task to email my admins when there are items pending in the Workbox. Maybe there is already a feature like this? The only piece of the puzzle I am missing is how to easily identify when/if Workbox items exist.

Instead of sending emails when an item is in a workflow state why don't you try using the RSS feeds that Sitecore generates for each state. Details are in the Client Configuration Cookbook.
The majority of email clients have built in RSS readers which typically will show the feed as a separate "inbox". IMHO this is much better than email alerts which often get ignored because of how spammy they can get.

The item is shown in the Workbox as long as it is in the workflow and not in the final state. Take a look at this shared source component - it seems to be just your requirement. This one is also quite similar.

Related

Detect Presence in AWS AppSync

I am working on an app that relies heavily on detecting when users go offline and go back online. I wanted to do this with AWS AppSync, but I can't seem to find a way to do this in the documentation. Is there a way to do it in AppSync?
Thanks for the question. Detecting presence is not currently support out of the box but you can likely build similar features yourself depending on the use case.
For example, a resolver on a subscription field is invoked every time a new device tries to open a subscription. You can use this resolver field to update some data source to tell the rest of your system that some user is currently subscribed. If using something like DynamoDB, you can use a TTL field to have records automatically removed after a certain amount of time and then require a user to "ping" every N minutes to specify that they are still online.
You could also have your application call a mutation when it first starts to register the user as online, then have the application call another mutation when the app closes to register it as offline. You could combine this with TTLs to prevent stale records in situations where the app crashes or something prevents the call to register as offline.
Thanks for the suggestion and hope this helps in the meantime.

Django: send message to all users (sessions)

I have a python+django project and want to implement following functionality: by certain trigger (at certain time or by manual admin action) show message to all active users (i.e. to all sessions).
Webpush seems unnecessary here as far as django has nice built-in messages subframework.
I guess I may develop such functionality manually: make sql table session_messages, each time take snapshot of all sessions and show message, perform some checks to assure that message is shown only once and only to active users, etc. etc.
Question: maybe there is some nice little library that already does it? Or even maybe django messages are able to do it "from the box"?
I've googled a bit but found only packages for webpush integrations.
Thanks :)
You must implement a software architecture based on django channels, redis or rabbitmq and signals
Basically you must open a socket at the moment the user logs in, add the authenticated user to a group, and when you trigger the event with the signals send a message to the group

OneSignal. List of notifications?

I am using a universal app template that uses OneSignal for push notifications which works perfect, however once the notification is dismissed or the app is opened it goes away and no way for the user to retrieve it or see if ever again.
I don’t know much programming and know just enough html to get me by. So I went through one signal documentation and found this.
https://documentation.onesignal.com/reference#view-notifications
So I created the php file and it does pull the list. Awesome! However it pulls a ton of info the user does not need to see and is poorly formatted. Is there a way of altering this code so I can display only the date, title and message?

What is the cheapest way to send fast website update alerts to users as push notifications?

I'm trying to help an animal shelter deliver faster updates when a new pet is added to their website. This is likely to happen between 0-20 times a day.
The website is a simple data dump, animals are in tables with row delineation (easy to parse) and have unique IDs. When a new pet is added, ideally this would trigger a mobile notification to subscribed users (could also be an email message). The faster updates are sent, the better, but checking every 30 mins or so would be fine. Because this is for a charity, I want to spend as little as possible on resources (because I also want to be able to scale this up for other shelters that might want to use this).
For instance mobile notifications, Twitter seems to be a good candidate. It looks like my needs wont run into fees/restrictions.
The part that I'm stuck on is how best to ping the site for updates and publish those updates to twitter. The two options I've come up with are:
Build my own system. Use a web crawler like Scrapy to periodically crawl the site and check for new petIDs. Using AWS, I think I could get by with a nano instance (~$57 a year). Using dynamoDB to cache existing petIDs seems like a small additional cost. Use twitter API to post updates
Use an RSS feed generator like Feedity. These seem to be pretty expensive: Feedity is $180/year for hourly updates and $390 for 15 minute updates. Has API integrated with Twitter.
I'd like to know if there are any better/simpler/cheaper/more obvious options I may be overlooking. Thanks!

get personal Amazon purchase history and simiar titles

I'm writing my own service to track my growing library and notify me of when books become available. I'm in the middle of 5 series waiting for the next book to come out. I also pick some up locally and would like to grab similar titles from amazon. How can I get my purchase history and similar titles? Is there an API for these? I haven't found anything from searches.
I don't think Amazon exposes an API for order history.
The closest thing seems to be the product advertising API: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Welcome.html
That would allow you to search for items, for example using ItemSearch:
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html
Alternatively, you probably could write a script scrape the data by navigating through the order history page, or to help you capture each page of results as you manually navigate your order history. You're on your own for this option, though.