Developer Documentation Library > Interviewer - Server > Configuration and customization > Customizing the email scheduler
 
Customizing the email scheduler
The Email Scheduling Wizard that displays when the Schedule link is clicked in the Email activity is implemented as an interview script named CreateSchedule.mdd. The script is in this folder:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\Interviewer Server\ FMRoot\Shared\Config
The default CreateSchedule.mdd script creates a single schedule that provides options for specifying the email schedule start and end time, the interval between batches, and the size of each batch. The script can be modified to create an email scheduler that meets specific business requirements.
A custom email scheduler script might include the following steps:
Read existing schedules.
Display existing schedules, if they exist, and allow users to add new schedules.
Write or update schedules.
Modifying the email scheduler requires an understanding of the scheduling tables as described SQL scheduling tables. Basic knowledge of interview scripting and templates is also required.
Two email schedule examples are provided:
CreateSchedule.mdd: The default script that is delivered with UNICOM Intelligence Interviewer.
CreateSchedule_MultiCountry.mdd: The script is in the UNICOM Intelligence Developer Documentation Library.
The examples use different methods for updating the SQL tables. As such, you might find it useful to familiarize yourself with both scripts before you decide on a particular implementation strategy.
CreateSchedule.mdd example
The default CreateSchedule.mdd script can create, modify, or delete a single schedule.
The ScheduleLayout.htm layout template organizes the items on the page and contains JavaScript and CSS that sets up the calendar and time controls. The template also sets up the Delete and Save controls.
The CreateSchedule.mdd script contains a page that can be used to define the project, job, and connection string (for debugging purposes). These items are normally passed into the interview as IOM.Properties.
The script uses the ReadScheduleData function and the SchedGetScheduleTask stored procedure to retrieve an existing schedule (if it exists). The stored procedure relies on the fact that there is only one schedule per project and email job for this version of the scheduler.
The SaveScheduleData function uses the EmailUpdateScheduleTask stored procedure to insert a single schedule.
CreateSchedule_MultiCountry.mdd example
The example CreateSchedule_MultiCountry.mdd script is in the UNICOM Intelligence Developer Documentation Library. It is in:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\DDL\Scripts\
Interview\Sample Management - Scripts\Interview\Utilities\CreateSchedule
The scheduler provides options for defining a separate email schedule for each country and language pair.
The ScheduleLayout.htm in this example is based on the default ScheduleLayout.htm, but also supports multiple schedules in a grid.
The ReadScheduleData function in this script demonstrates how to use a SQL statement to retrieve the schedules (instead of a stored procedure).
The SaveScheduleData function uses the InsertScheduleRow,InsertSendEmailTaskRow and InsertScheduleTaskRow functions to safely insert SQL data into the three scheduling tables. The functions can be used in custom scripts to create more complex schedules.
See also
Configuration and customization