Using Queries
The Fast E-Delivery Engine contains inner lists for storing e-mail addresses. But in some instances it is needed to use addresses or other information from an external database. For example you need to send invoices to a vast number of recipients. The addresses and other information related to the recipients are stored in a corporate database server. In a situation like this it is recommended to use Queries. Queries gives you the ability to insert the message data from the server. Query consists of the following attributes.
- A connection string - Specifies how Fast E-Delivery Engine will connect to the external database
- SQL SELECT statement - Specifies what information will be retrieved from the database.
Every query has a unique name, which is used to distinguish the query. The queries can be used from the campaign messages in the same manner as inner lists. But when the query is selected as a recipient list you must specify the field from where the e-mail addresses will be inserted in the To field of the messages. Because the query can return multiple fields from the database. The rest of the fields are called "Atributes" and the values of these fields can be inserted in to the messages using the name of the query and the name of the field in this query using the following syntax [@QueryName]("FieldName").
The following is a typical scenario of using the queries.
You create a query named "Customers", which consists of a connection string for connecting to the database, and a SQL query statement, which retrieve the address field and the recipient name field from database.
When you create a campaign message you have the possibility to add as a recipient list in to the created query. In the messages body you can write:
Dear [Name],
We have the pleasure to inform you...
If the query return two rows with the following data
Customer1@domain.com |
John Smith |
Customer2@domain.com |
George Beasley |
The Fast E-Delivery Engine will send two emails, one to Customer1@domain.com with the following content:
Dear John Smith,
We have the pleasure to inform you...
And one to the Customer2@domain.com with the following content:
Dear George Beasley,
We have the pleasure to inform you..
|