Email Notifications

Overview

Email Notifications can be sent to any entity on the database: Staff, Customers and Suppliers. They can also be sent to addresses which are not listed in the database. The process is driven by SQL, so for instance, if you want to send Notifications to Customers when their jobs are complete, you could, at fixed intervals, run a query to check for completed Sales Orders which are not in the Notification-Sent Audit. The application will send an email to each of the rows that are returned. The Log file is updated with the details of every e-mail that gets sent out.

Adding a new Email notification

Click on Menu > Email and click the New button

  • Description - Add a brief description of what the email contains and who it will be sent to.

  • Sender Name - The name of the Sender visible to the Recipient when they receive the email.

  • Sender Address - The e-mail address of the Sender which will also be the Reply-To address.

  • Connection String - Right-click and select Edit Connection String - This is the database from which the email content will be selected

  • SQL - Right-click and select Edit SQL - See below for more detail on how the SQL needs to be structured. Click the Template button to create an SQL sample.

  • Schedule - Right-click and select Edit Schedule - See Scheduler for more detail.

How it works

When the Action is executed, the records returned from the SQL are iterated and an email is created for each record. If the SQL does not return any records, emails won't be sent out. Emails will only be sent for records where all of the following fields have values:

  • Email To

  • From Name

  • From Address

  • Body

SQL

The following fields need to be returned by the SQL:

  • EMAIL_TO - blob sub-type text - This field can contain multiple email addresses, separated with a semi-colon.

  • EMAIL_CC - blob sub-type text - This field can contain multiple email addresses, separated with a semi-colon.

  • EMAIL_BCC - blob sub-type text

  • SUBJECT - varchar(250)

  • BODY - blob sub-type text - This is the email body and needs to be in an HTML format

The EMAIL_... fields can contain multiple email addresses, separated with a semi-colon.

Creating HTML with SQL

A number of stored procedures are provided to make this really simple. They include:

  • HTML_STYLE - Serves as your Style Sheet

  • HTML_TR - Used to create Table rows

  • HTML_LIST - Used to create a bulleted or numbered List