Creating an e-campaign messages file The messages displayed by the e-campaign applications are stored in an e-campaign messages file called ecampaign.messages, which can be found in ch15
Trang 1T ABLE15-2 ecampaign.conf VARIABLES (Continued)
$LIST_FIELD_MAP_TBL Name of the list map table
$ECAMPAIGN_TBL Name of the campaign table
$ECAMPAIGN_MESSAGE_TBL Name of the message table
$MESSAGE_HDRS_TBL Name of the message header table
$ECAMPAIGN_EXECUTION_TBL Name of the execution table
$ECAMPAIGN_ASSEMBLY_TBL Name of the assembly table
$ECAMPAIGN_TRACK_TBL Name of the URL track table
$ECAMPAIGN_UNSUB_TBL Name of the unsubscription table
$ECAMPAIGN_BOUNCED_TBL Name of the bounced e-mail table
$REPORT_EVEN_ROW_COLOR HTML color code for even rows in a report table
$REPORT_ODD_ROW_COLOR HTML color code for odd rows in a report table
$FROM_HEADER Header ID for the From header
$REPLY_HEADER Header ID for the Reply-to header
$PRIORITY_HEADER Header ID for the Priority header
$SUBJECT_HEADER Header ID for the Subject header
Creating an e-campaign messages file
The messages displayed by the e-campaign applications are stored in an e-campaign messages file called ecampaign.messages, which can be found in ch15/apps directory in the CDROM
Creating an e-campaign errors file
The error messages displayed by the e-campaign applications are stored in an e-campaign error messages file called ecampaign.errors, which can be found in ch15/appsdirectory in the CDROM
Creating Interface Template Files
The HTML interface templates needed for the e-campaign applications are included
on the CD-ROM These templates contain various template tags to dynamically
Trang 2display necessary information Table 15-3 shows which template file is used for what purpose
T ABLE 15-3 INTERFACE TEMPLATE FILES
$ECAMPAIGN_ADD_TEMPLATE ecampaign_add.ihtml
$ECAMPAIGN_MENU_TEMPLATE ecampaign_menu.ihtml
$ECAMPAIGN_ADD_URL_TEMPLATE ecampaign_add_url.ihtml
$ECAMPAIGN_EXECUTION_TEMPLATE ecampaign_execute.ihtml
$ECAMPAIGN_ADD_LIST_TEMPLATE ecampaign_add_list.ihtml
$ECAMPAIGN_MAPPING_TEMPLATE ecampaign_take_map.ihtml
$ECAMPAIGN_ADD_CAMPAIGN_TEMPLATE ecampaign_add_campaign.ihtml
$ECAMPAIGN_ADD_LABEL_TEMPLATE ecampaign_add_label.ihtml
$ECAMPAIGN_REPORT_TEMPLATE ecampaign_report.ihtml
$ECAMPAIGN_MOD_URL_TEMPLATE ecampaign_modify_url.ihtml
$ECAMPAIGN_ADD_MESSAGE_TEMPLATE ecampaign_add_message.ihtml
$ECAMPAIGN_PREVIEW_MESSAGE_TEMPLATE ecampaign_preview_message
$ECAMPAIGN_MOD_LIST_TEMPLATE ecampaign_mod_list.ihtml
$ECAMPAIGN_UNSUB_TEMPLATE ecampaign_unsub.ihtml
$ECAMPAIGN_PREVIEW_MESSAGE_ ecampaign_preview_message_
$ECAMPAIGN_PREVIEW_MESSAGE_ ecampaign_preview_message_
$ECAMPAIGN_PREVIEW_MESSAGE_TEMPLATE ecampaign_preview_
message.ihtml
$ECAMPAIGN_UNSUB_CONFIRM_TEMPLATE ecampaign_unsub_
confirmation.ihtml
Now you’re ready to create the e-campaign applications
Trang 3Creating an E-campaign User Interface Application
This application displays the main user interface for the e-campaign applications The main user interface application called ecampaign_mngr.phpcan be found in ch15/appsdirectory in the CDROM The methods implemented by this user inter-face application are discussed in the following sections
run( )
This method calls the displayMenu()method to display the user interface
displayMenu( )
This method displays the main user interface This method creates a Listobject, a URLobject, and a Campaignobject to get lists of lists, URLs, and campaigns to dis-play in the interface
authorize( )
This method returns TRUEsince, in the current version everyone is allowed to view the campaign report If you want to restrict access to the report to a specific user or group of users, you’ll have to modify this method to implement your restrictions
Creating a List Manager Application
The list-management application manipulates lists The list-creation process is shown
in Figure 15-3
The ecampaign_list_mngr.php application that can be found in ch15/apps directory in the CDROM, which implements the list creation, modification, and deletion process This application has the following methods
run( )
This method uses a form variable called the $cmdvariable, which is set in the user interface displayed by ecampaign_mngr.php, to select the appropriate function to implement the list operation
When $cmdis set to add, it calls the addDriver()method to add a list When
$cmdis set to modify, it calls the modDriver()method to modify a list; otherwise,
it calls the delList()method to delete a list
Trang 4Figure 15-3: How a list is created.
addDriver( )
This method uses $step, a variable set in the add list interface forms, to control which method is called The $stepvariable is used to select the appropriate method for the appropriate stage of the list adding process Here is how the addDriver() works:
◆ If $stepis not set, then the first step of the add list process is started by calling displayAddListMenu(), which shows the add list interface This interface sets the $stepto 2, using a hidden HTML field
◆ If $stepis set to 2, then the second step of the add list process is started
by calling the addList()method This method stores the list configura-tion data collected in the previous step and displays the database field mapping interface by calling the takeMap()method This interface sets the $stepvalue to 3
Start
Get list configuration information such
as database hostname, database name, username, password, and the table name, which contains the customer data (EMAIL, RECORD ID, etc.) Ask user to give this list a name.
End
Connect to the given list database and get meta data for the chosen list table.
Map table fields with standard campaign fields (used for personalization)
Store list access and mapping information in e-campaign database
Trang 5◆ If $stepis set to 3, then the database field map that maps the standard personalization fields such as REC_ID, FIRST, LAST, AGE, SEX, INCOME, and EMAILis stored in the database using the addDatabaseFieldMapmethod
modifyDriver( )
This method uses $step, a variable set in the modify list interface forms, to control which method is called The $stepvariable is used to select the appropriate method for the appropriate stage of the list modification process Here is how the modifyDriver()method works:
◆ If $stepis not set, then the first step of the modify list process is started
by calling displayModifyListMenu(), which shows the modify list inter-face This interface sets the $stepto 2, using a hidden HTML field
◆ If $stepis set to 2, then the second step of the modify list process is started by calling the modifyList()method This method stores the list configuration data collected in the previous step and displays the database field mapping interface by calling the takeMap()method This interface sets the $stepvalue to 3
◆ If $stepis set to 3, then the database field map that maps the standard personalization fields such as REC_ID, FIRST, LAST, AGE, SEX, INCOME, and EMAILare stored in the database using the modifyDatabaseFieldMap method
authorize( )
See the authorize() method in the e-campaign user interface application called ecampaign_mngr.phpfor details
displayAddListMenu( )
This method displays the add list interface
displayModListMenu( )
This method displays the modify list interface
modifyList( )
This method is called when a user makes changes in the modify interface shown by displayModListMenu() The modifyList() method creates a list object and calls its modEcampaignList()method to update the list in the database