CTMailMerge Implementation Overview


1. Create the CTBroadcaster Folder Structure
Determine where you want the queue action to take place and build the appropriate structure.
2. Add CTBroadcaster to your system
the software. You will have to contact Call Tom to get the password needed to unzip the archive file if you did not receive your email after purchase. The DLL is used by both applications.
3. Install CTBroadcaster as a Windows Service
Use standard tools to add CTBroadcaster to your system. Check out these helpful links:
o  How to create a Windows service by using Sc.exe
o  Install Windows Service without Visual Studio
4. Edit the CTBroadcaster Application Config
Once installed, locate and edit the Application config file. Make the appropriate changes reflecting the Folder Structure created earlier.
5. Start the Service
Use the Service Utility to start the CTBroadcaster Service and change its startup mode to 'Auto'. Each time the Service is started, the config file will be read (applying any changes) and the application will be ready to process requests.

Adding CTMailMerge

1. Locate the Mail Merge folder
When you created the folder structure for CTBroadcaster, you should have also create the MailMerge folder. If not, you can actually place the folder anywhere on your system. Just make sure you update the CTBroadcaster config file to reflect the change.
2. Add the executables to the folder
Simply place the CTMailMerge.exe and clsGeneralLib.dll files (that you recevied in your downloaded zip file) in the MailMerge folder.

Getting the System to Process a Job

1. Edit Template File
Make changes to the Template file (job file) as shown below. You can use a locally written application or manually edit the file.
2. Save the File
Save the edited template to the 'job' folder of CTBroadcaster. Do this via your application or manually 'save as' from your file editor.
2. Copy the 'queue' File
Copy/drop or copy the queue file containing the keyword 'MAILMERGE' to the 'que' folder of CTBroadcaster. This action will start the job. That's it!

Queue, Job and Log files

General Process Overview
CTBroadcaster will respond to a file create event in the application Queue folder (specified in the .config file). Whenever a new queue file arrives, processing by the specified applet will be initiated.

If your system is restarted, the CTBroadcaster service will fire off any unprocessed queue job found in the queue folder.

Processed queue files are deleted from the queue folder.
Queue File Overview
The location and extension of the queue file is configurable. By default, we use the extension .que and a folder name of queue.

File Rules
  • CTBroadcaster requires that the queue file contain the name of the applet to be used, as specified in the .config file. Currently MAILMERGE_PROCESSOR and GENERIC_PROCESSOR are predefined. Future enhancements will allow additional applets to be specified.
  • If the applet uses a job file (one that directs activity as in the case of Mail Merge), the job file should be delivered to the job folder BEFORE the queue file is delivered to the queue folder
  • The queue file and the job file must have the same name, differentiated only by the file extension.
  • Queue files are deleted once they are processed.
Job and Log Files
Job files are specific to the applet. The Mail Merge applet has a job file that is briefly outlined below. If you create an applet, the job file will be unique to the functionality that you specify in your applet. If you do not require a job file, simply do not include it with your applet.

CTBroadcaster uses the Log File to record activity performed by the service. Similar activity is also recorded in the system Event Log.

The MailMerge Applet Job file

XML Format Job File
The job file for CTMailMerge maintains an established XML format (as seen in the image). Primary components of the file are briefly discussed below.

All sections of the file must be named as shown. 'job_type' must be specified as MailMerge.

The following sections will be reviewed:
  • job_priorities
  • mail_server
  • mail_message
  • mail_routing
  • wildcards
  • mail_merge
Job priorities help the application identify and classify jobs. Higher priority jobs will be given more consideration when the processor has to decide on which job to launch next.

Note: This information can be hardcoded in you job file template.
Your mail server must be identified to the application. This section is used to provide the appropriate information on a job-by-job basis.

This information will specify the mail server CTMailMerge will use to send the merged emails to your email targets.

Note: This information can be hardcoded in you job file template.
Performing 'mass mailings' using CTMailMerge center around delivering the same message to your target email base. The message being delivered is specified in this section along with an appropriate subject line.

  • This section can be populated by your application (if you want to make the template dynamic and usable in many situations), or it can be hardcoded in your template. The latter approach can be used should you wish to use a single template file related to a specific action performed by the application.
  • Two wildcard tags (substitutable keywords) are available for you to decorate your text. The tags are ##FIRSTNAME## and ##LASTNAME##. Keep in mind that these tags were thought to contain the obviously associated information, however, they may contain any textual information you would like to vary based on your email target.
  • 'body_is_html' is defaulted to 'true' in the template. That means that the text within the email will support html formatting. Turn this off to use plain text.
Specification of a 'from' address is required. 'cc' and 'bcc' are optional and may be left blank. These addresses are used to identify to the recipient who the email is from (as in the case of 'from'). The other two provide for the specification of an internal (to your organization) address where a copy of the email should be sent.

'sendlog_filename' is specified as a local file where the CTMailMerge application can record information about status and progress of the mailing process.

Note: This information can be hardcoded in you job file template.
Identification of the two wildcard tags (see 'mail_message' above).

Note: This information can be hardcoded in you job file template.
The 'mail_merge' section will contain a complete list of every email address being targeted by your application. This section can be dynamically built by your application, or a static list can be created in your template for repeated use.

Each 'to' section within 'mail_merge' MUST contain the 5 items shown.

  • 'status' should ALWAYS be set to 'NotStarted' before your job executes. CTMailMerge will change the status after the email is sent.
Note: The additional 'to' sections shown are not required and represent content that was collapsed for this display.