Email alerts tutorial

To go with our tutorial on setting up a Google calendar synchronisation, here’s one on setting up the system to send out email alerts when certain criteria are reached. Examples may be a new lead has been assigned to a salesperson, a person’s training is coming up for renewal or a purchase order has gone over a price threshold.

Note we’ll be happy to set up email alerts as part of your system setup, but if you want to do this on your own, then just follow this process.

Note: When setting up an email alert, the system needs to know the email address of the recipient. Sometimes this may be very simple, when you always want to send the alert to the same person. For some alerts though you may wish to change who gets it depending on the data, e.g. each salesperson may get the leads assigned to them. In this case, the system will need to know the email address, so it needs to be stored somewhere. For agileBase users, if they use their email address as their username, the system can pick this up when a user’s assigned to a record, either manually or as part of the automatic ‘created by’ and ‘modified by’ fields

Step 1: add a necessary field

Select the table which has the alert data in it and add a date/time field with SECOND accuracy called e.g. “Last notified”. This will be used by the system to store when the last notification was sent for each record.

Step 2: create a new view

Create a view from the table above, containing all the information you want to send in the email. Sort if by “last modified [auto]” descending, so new items appear at the top.

Step 3: add filters

Add filters so that only records that need an email notification to be sent appear. It’s important that records must disappear once a notification’s been sent otherwise the recipient will be bombarded with repeat alerts.

For simple alerts of new items, add a filter “Last notified IS NULL”. That way, a notification will only ever be sent once for a record.

To set up a repeating monthly alert, you could add a calculation:

Send Alert (boolean):

{last notified} is null OR {last notified} < (now() - interval '1 month')

and filter on “Send Alert = true”

If you have any difficulty thinking up what criteria you need for your purpose, please get in touch.

Step 4: fill in an email template

In the view’s manage tab, under ‘Sync’, fill in the subject, to and body of the email. To merge in data from the view, use field names in lowercase surrounded by curly brackets. A typical template would look something like this:

email template

Under the email template, set “Notification time field” to the field that you created in step 1, e.g. “Last notified”

Note in the To: field, you can include email addresses manually (as above), or merge them in from the view. If you are assigning records to users in agileBase, you can use that field and the system will automatically pick out the email address for them, as long as their username is their email address.

That’s it! Note when testing, we recommend setting the “To:” value to your own email address, just until you’re sure everything’s working properly.

One Reply to “Email alerts tutorial”

Leave a Reply to Cliff Calcutt Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: