In this use case, we will explore using the result of an SQL Query as a trigger to send an alert email. This is useful for verifying that data has been loaded and other validation checks. For example, maybe you want to be alerted when a new support request is generated or a new customer has signed up.
All you have to do is register for a Nom Nom Data account and follow the steps to install a Nominode. Using the Nominode is free and no credit card is required.
SELECT COUNT(*) > 0 FROM users WHERE created >= NOW() -1 Day;The actual query line will depend on your database type and content. The example will return true when any new users have been created within 24 hours of when it is run. A true result triggers an email to be sent.
Now that you’ve created a Task to send an email based on an SQL Query result, you probably want to run it on a regular basis. Just create a new Sequence to do that. For this example, running the Task daily would make sense, but you can adjust the frequency to whatever you want.
You can test running your Task before it runs on schedule by running the Sequence manually. And that’s it, you have successfully used an SQL query to automatically trigger sending emails.
For more details, use the ? icons next to the fields in the Task or visit our SQL Alerter Engine support page.