IMapTrigger for Azure web jobs - azure

I want to run a web job if a specific email is received. Currently, I use a TimerTrigger and create an ImapClient which reads the unread emails and scans for one with the appropriate content. This works fine but there is a delay of whatever duration I set my timer to. Ideally, I would like an IMapTrigger (if such a thing exists) which would fire whenever a new email appears.
Does a) such a thing exist, b) is it worth writing one?

Related

How to create a metric alert in Azure that only fires during a specified timeframe?

I have a logic app set up that so that when a file is received on the FTP it gets put into the blob. The file is coming from a third party and it will be coming (supposedly) by 4am every morning. I want to set up an alert to know if the file didn't get received by 4am.
I've gone through all the different types of alerts and triggers, but I can't seem to figure out how to make one trigger when an event DOESN'T happen. I also can't figure out how to make the alert only check for a certain timeframe. I'm thinking I'm going to have to make my own alert by adding an action onto the logic app, but I'm at a loss.
Out of the box I don't think it's possible.
You could create a simple BlobTrigger Azure Function that when the file is changed/uploaded, the function will fire. When the function fires you can write a custom metric to app insights that you can then query on in the alert.
I solved this issue:
So I set up a logic app with a recurrence of 4am every day. It sets a flag variable to false, then lists every blob within the folder the blobs are coming in to. It checks every blob in it to see if the last modified date is today (the folder gets emptied daily with another logic) If it finds one it sets the flag as true and then nothing happens. If it doesn't the flag is still false so it sends an email saying the file was not sent today.

Twilio SMS with links - links being clicked automatically?

I have an app that sends SMS's out to a bunch of people. Those messages contain links. They are not using any link shorteners or any other service. They link back to my site. The links themselves are randomized strings, which are stored in my db, which are associated with an action. (Click "yes" or "no" link and the db tracks what you chose.) For ALL users, this works perfectly. With one user - and it's always the same user, as soon as the cron job runs, which triggers this event, his "vote" comes in. This is without him clicking or even seeing the message sometimes.
So, the question: has anyone ever seen or heard of a cell provider or a messaging app or similar that "clicks" links as part of some process before sharing the content with the user? I can't see ANYTHING in the code that would single him out so I'm thinking it has to be something in between when the message goes out and he does what he does. Especially because the timestamp is also always within seconds of the cron job running.
Sending an SMS can sometimes go through multiple carriers before reaching an end destination. As such, providers may be "handling" the content in this case.
The best thing to do would for any cases of this in the future would be to write support for further investigation.

automation of tasks - email using web application

I have a web application that monitors farms in certain areas. Right now I am having a problem of performing automation with some of the tasks.
Users of the web application can send reports or checkins using keywords. If the reports or checkins correspond to certain keywords, for example "alert", I need the web application to send an alert to the user via email using that web application. But that alert must be sent two weeks after the date of the report received, and to that particular user only.
Would it be possible to use cron to perform this? If not, can anyone suggest me a workaround?
A possible approach you might consider is to store an entry in a database for each of these reminder emails you need to send, at the time your user does whatever action in your application that determines the need to send that email exists. Include the recipient, the date to be sent, and the email content as content you store for each entry. Schedule a single cron job to run periodically to process these database records by due date, and populate an email template to be sent out. You can then either delete the database records, or a better option, include a column that indicates they were sent and mark them as sent.
It would help to provide which technology stack you're operating on and what the application is developed in. Others might be able to point you to technology specific approaches or pre-built plugins/extensions that already do this for the situation you're in, to help you avoid the need to write your own code for the solution.

Refresh Mailed-in Document in Lotus Notes

I am having a serious brain cramp right now since I don't think I have done this in 10 years...maybe I never did but I THINK I did lol.
I have a new mail-in database. When mail comes in, either from Lotus Notes, from an outside mail system, like gmail, or from a text message from a cell phone, I want to refresh that document so that a couple fields get set based on the SMPTOriginator that the mail is from. I thought I would do it with an agent that runs before mail arrives, but that didn't work. I tried after mail arrives and that also didn't work. I need it to runn almost immediately after the document arrives because they are getting emergency responders to reply ASAP and I need these documents to refresh as they come in.
Can someone point me in the right direction...this is something that I know I have done in the past, I just can't remember.
Maybe you just don't have the necessary rights to run the agent. In any case, when the agent is correctly placed and the mail db receives a mail, the agent is started by the server (either the Agent Manager or the Router), and if the agent isn't started there is a message in the log.nsf database. Check there.
I would think the events you tried would have worked, but perhaps they are only for mail databases, and not mail-in databases.
Anyway, you could use the "After documents are created or modified" trigger, although that won't run immediately. It runs about every 5 minutes, I believe.
You might also create a scheduled agent. If the process isn't very long, you might be able to get away with it running every, say, 2 minutes.

Drupal time based triggers

I'm building an event signup system and integrating it with Ubercart. Each event is a product and has a price and a start time.
I wish to be able to trigger an action one week before the event starts. The action is supposed to send an email to the users that bought the event and perform a capture on the registrant's credit card. But where do I define the action and how do I trigger it one week before event start?
I assume you're talking about Drupal 6, since you're mentioning ubercart. Does the action to send the email you're takling about already exist?
If it does, you can assign it under Site Building | Triggers | Cron. If it doesn't show up in the list of actions, you might need the Triggerunlock module.
If the action doesn't exist, you're going to have to write the PHP code to send the emails and do the calculations. You will need to create your own module and either use hook_cron, or create a custom action.

Resources