Customize:CustomEmail

From InClickAdServer

Custom Email Processor

The Custom Email Processor is a class extension of the factory email processing system. By utilizing PHP’s ability to extend classes, you are able to modify system email messages while continuing to maintain full interoperability with future releases without modifications to the source code.

Deploying the Custom Email Processor

The configuration of a Custom Email Processor is accomplished by extending on the EmailMessageProcessor() class, the ad server's factory email processor class. The instructions below utilizes a file that can be found in the CustomEmailProcessor.zip package found here.

  1. Upload Files
    Upload the contents of CustomEmailProcessor.zip package noting the path. For this example, you can upload the file and directory structure into the ad server root directory:
    Image:CustomEmailUploadFilestructure.jpg
    Upload the files into the ad server root directory maintaining the directory structure as outlined above.
    • CustomEmailMessageProcess.php – This file contains the class.
    • CustomEmailMessageProcessor which extends the EmailMessageProcessor () factory class.
  2. Initialize the CustomEmailMessageProcessor Service
    To initialize the Custom Email Processor, you will need to edit the /globals/globals_custom.php file and add the following lines of code inside the PHP tags (one line of code): NOTE: Be sure to replace "THE_PATH_TO" in the example code with the correct path to the custom directory.
  3. Writing Custom Email Content
    Inside the CustomEmailMessageProcessor class is a series of functions. Each function corresponds to a specific message that will be sent. For example, the function sendAdvertiserWelcomeEmail is the welcome email message sent to a new advertiser when they create their account. The available functions are outlined below:
    • getSignature – The signature line for all messages sent
    • sendAdvertiserWelcomeEmail – New Advertiser welcome message. Sent to the advertiser soon after the account has been created
    • sendPublisherWelcomeEmail – New Publisher welcome message. Sent to the publisher soon after the account has been created.
    • SendPasswordResetEmail – Sent when a user resets their password if they have lost it. This message is sent only when the email address is found in the system.
    • SendAccountNotFoundEmail – Sent when a user attempts to reset a password to an account that does not exist.
    • SendPasswordChangedEmail – Sent as a notice to the account holder that their account password has been changed.
    • SendRebillingDeclinedEmail – If subscribed to automatic funding, this message is sent if the credit card is declined.
    • SendRebillingSuccessfulEmail – If the advertiser is subscribed to automatic funding, this message is sent on a successful charge.
    • SendLowFundsEmail – For advertisers not subscribed to automatic funding, this message is sent to remind the advertiser that funds in their account are running out.
    • SendCampaignRequiresModificationWithReasonsEmail – When the administrator pauses an advertisement with a reason, the content of this message is used.
    • SendCampaignApprovalEmail – When the administrator approves a campaign with a notice, this message is sent.