uProduce Email Plug-in SDK

Introduction

The XMPie uProduce server, when licensed for cross media features, can serve as a production hub for transactional and marketing or bulk email messaging as part of a campaign designed and executed in Circle.

Out-of-the-box uProduce provides three delivery providers which are used for distribution of the composed email messages: Prepare for email distribution; SMTP Server; and XMPie Email Service (XES).

If required, it is possible to extend uProduce by developing delivery providers that integrate with other email services for the final delivery of the messages.

The SDK describes the implementation of the XMPie Email Plug-in sample. The sample demonstrates the creation of a custom XMPie Email plug-in and how to add it to the delivery providers displayed in the uProduce dashboard, which are also made available to Circle. In addition, there is a possibility to add the Tracking functionality which is also described in the SDK.

Plug-in Types

uProduce allows you to implement two types of email plug-ins: Template and Composed. The Template mode assumes that the delivery provider knows how to compose the email based on a template and a list of recipients with the ADOR or content object values.

For example:

Template

Copy
<body>
  <p>
    Dear {{FIRST_NAME}} {{LAST_NAME}},
  </p>
  <p>
    Visit our website to register to the Open House event.
  </p>
</body>

Dynamic Objects

Name

Value

FIRST_NAME

John

LAST_NAME

Miller

EMAIL

John.Miller@gmail.com

Note: If the email document type in uProduce is ‘URL’, then the template will contain HTML_BODY and TEXT_BODY ADORs which represents the entire composed message body.

When using the Composed mode, the delivery provider receives the already composed email and must only implement the sending operation:

Copy
<body>
  <p>
    Dear John Miller,
  </p>
  <p>
    Visit our website to register to the Open House event.
  </p>
</body>

To each one of the email plug-ins, whether Template or Composed, you can add the email tracking functionality using the Tracking add-on (see Tracking).

Accessing the SDK

XMPie provides the uProduce Email Plug-in SDK that includes a sample Visual Studio solution that demonstrates how to create a custom Post Composition Operation C#.

Customers who have purchased the uProduce API license can request the uProduce Email Plug-in SDK from XMPie Support.

SDK setup

To work with the email plug-in sample, you will need Microsoft Visual Studio installed on a uProduce Development Server.

Unzip the EmailProviderSample.zip to a desired location and open the solution.

Composed Mode

When using the Composed mode, the delivery provider receives the already composed email and must only implement the sending operation.

To send emails using the XMPie Email Plug-in in a Composed mode, you need to perform the following steps:

  1. Create a user control containing a set of provider-specific parameters (see Composed User Control).

  2. Create a plug-in responsible for sending emails (see Composed Plug-in).

  3. Update the TBL_DELIVERY_PROVIDER_TYPES table in the XMPDB2 database with the following parameters:

    • The Delivery Provider name

    • The plug-in DLL file name

    • The Class name

    • The User Control name

  1. Verify your plug-in using the uProduce Dashboard user interface:

    • Create a delivery provider

    • Send an email using this delivery provider.

  1. Implement the Tracking add-on (optional) (see Tracking).

Composed User Control

The User Control is displayed in uProduce Dashboard (Settings > Delivery Providers) and contains the private parameters of the Delivery Provider (for example, SMTP server name, user name, etc.). The entered parameter values are saved to the database and then used when sending emails.

To create a User Control:

  1. Open the Visual Studio and select File > New > Project.

  2. Create a new Visual C# web application. Set its name to EmailSampleUI and click OK.

  3. Add a reference to XMPEmailProviderInterface.dll. The DLL file is located in the uProduce installation folder:

    <Installation Drive>:/XMPie/XMPieExec

  1. Right-click the EmailSampleUI project and select Add > New Item.

  2. Select a Web User Control and name it EmailComposedSampleUI.ascx and click Add.

  3. Design the user control:

    • From the toolbox, drag a label and set the Text property to Name:.

      • From the toolbox, drag a text box and set the ID property to TextBoxName.

      • From the toolbox, drag a label and set the Text property to SMTP Server.

      • From the toolbox, drag a text box and set the ID property to TextBoxSMTPServer.

The resulting EmailSampleComposedUI.ascx file will look as follows:

Copy
<%@ Control Language="C#" AutoEventWireup="true"
      CodeBehind="EmailComposedSampleUI.ascx.cs"
      Inherits="EmailSampleUI.EmailComposedSampleUI" %>
<asp:Label ID="Label1" runat="server" Text="Name:"></asp:Label>
<asp:TextBox ID="TextBoxName" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label2" runat="server" Text="SMTP Server:"></asp:Label>
<asp:TextBox ID="TextBoxSMTPServer" runat="server"></asp:TextBox>
  1. Open the EmailComposedSampleUI.ascx.cs file and add:

    using EmailProviderExInterface;

  1. Set the class to inherit from IEmailProviderUserControl in addition to the System.Web.UI.UserControl and implement it. Below is the sample code for IEmailProviderUserControl interface implementation:

    Copy
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using EmailProviderExInterface;
    namespace EmailSampleUI
    {
      public partial class EmailComposedSampleUI : System.Web.UI.UserControl,
          IEmailProviderUserControl
      {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        public string DeliveryProviderID { get; set; }
        public string DeliveryProviderParameters { get; set; }
        public string InitControls()
        {
          return null;
        }
        public string Name { get; set; }
        public void PopulateControlValues()
        {
          TextBoxName.Text = Name;
          TextBoxSMTPServer.Text = DeliveryProviderParameters;
          SupportTest = true;
        }
        public void SaveControlValues()
        {
          Name = TextBoxName.Text.Trim();
          DeliveryProviderParameters = TextBoxSMTPServer.Text;
        }
        public bool SupportTest { get; set; }
        public bool Test()
        {
          return true;
        }
        public int TypeID { get; set; }
        public bool ValidatePage()
        {
          return true;
        }
      }
    }
  2. Build the project and copy the EmailSampleUI.dll from the bin folder to \XMPie\XMPieDashboard\bin

  3. Copy the EmailComposedSampleUI.ascx file to XMPie\XMPieDashboard\Settings\DeliveryProviders

  4. Edit the \XMPie\XMPieDashboard\PrecompiledApp.config file and ensure that updatable is set to true.

    Note: if you need to change the value to true, for the change to take effect you will need to restart IIS by running iisreset in a command window.

Note: In configurations with multiple director servers, the user controls should be copied to all directors running the dashboard application.

Composed Plug-in

Overview

uProduce calls the Composed plug-in to initialize and then it calls the Process method for each recipient. In this example we call the SMTP send email method in every process call. In a “real” implementation, you might want to collect the information and send it in batches.

The Composed plug-in implements the email sending process as follows:

  1. uProduce calls the ComposedInitialize method in the beginning of the Send Email job process.

  2. uProduce calls the ComposedProcess method with the composed email body.

    In this sample, every process call triggers the SMTP email send operation per recipient. In a “real” implementation, you might wish to collect the information for several recipients and then send an email batch.

  1. uProduce calls the ComposedFinalize method in the end of the job process.

Plug-in Creation

To create a Composed plug-in:

  1. Open the Visual Studio and select File > New > Project.

  2. Create a new Visual C# Class library. Set its name to EmailComposedPluginSample and click OK.

  3. Rename the class name from class1.cs to EmailComposedSample.cs.

  4. Click on Yes at the dialog box.

  5. Add a reference to XMPEmailProviderInterface.dll. The DLL file is located in the uProduce installation folder : <Installation Drive>:/XMPie/XMPieExec.

  1. Open the EmailComposedSample.cs file and add: using EmailProviderExInterface;

    Set the EmailComposedSample class to inherit from IEmailComposedProvider:

    Copy
    public class EmailComposedSample : IEmailComposedProvider
    {
    }
  2. Implement the IEmailComposedProvider interface.

    Below is the sample code for IEmailComposedProvider interface implementation:

    Copy
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using EmailProviderExInterface;
    using System.Net.Mail;
    namespace EmailComposedPluginSample
    {
      public class EmailComposedSample : IEmailComposedProvider
      {
        public string SMTPServer { get; set; }
        public void ComposedAbort(EmailAbortEnum inReason)
        {
          // TODO: Add cleanup here
        }
        public void ComposedFinalize()
        {
          // TODO: Add finalization code here
        }
        public void ComposedInitialize(string inEmailProviderParameters,
            EmailProviderSendContext inContext,
            EmailComposedParameters inParameters,
            ref AutomaticAdors inoutAutomaticAdors)
        {
          // TODO: add initialization code here
          SMTPServer = inEmailProviderParameters;
        }
        public void ComposedProcess(EmailComposedProcessParameters inParameters)
        {
          // Create a message and set up the recipients.
          MailMessage message = new MailMessage(
              inParameters.Header.From.Address,
              inParameters.Header.To[0].Address,
              inParameters.Header.Subject,
              inParameters.HTMLComposedBody);
          //Send the message.
          SmtpClient client = new SmtpClient(SMTPServer);
          // Add credentials if the SMTP server requires them.
          // client.Credentials = new NetworkCredential(userName, password);
          try
          {
            client.Send(message);
          }
          catch (Exception ex)
          {
            Console.WriteLine("Exception caught in ComposedProcess: {0}",
                  ex.ToString());
            throw (new EmailProviderFatalErrorException(ex.Message));
          }
        }
        public EmailProviderServices EmailServices { get; set; }
      }
    }
  3. You can test the plug-in using the EmailPluginTest project:

    • Open the EmailPluginTest.cs file and change the following parameters:

    Copy
    private const string SMTP_SERVER_NAME = "mySMTPServer";
    private const string TO_EMAIL = "myemail@example.com";
    private const string OUTPUT_FOLDER = @"c:\\output ";
    • Run the EmailComposedPlugin test method.

  4. Copy the EmailComposedPluginSample.dll to \XMPie\XMPieExec

Note: In configurations with multiple extension servers, the binary files should be copied to all extensions running email production.

Database Setup

Add a new record to the TBL_DELIVERY_PROVIDER_TYPES table in the XMPDB2 database. This record contains the following columns:

Column

Description

DeliveryProviderTypeID

Enter number > 1000

DeliveryProviderTypeName

name of the plug-in

DeliveryProviderTypeAssemblyPath

Assembly path

DeliveryProviderTypeClassName

Class name

DeliveryProviderTypeControlName

Control name

DeliveryProviderTypeControlAdditionalParams

Leave null

SendEmailAsTransactionalByDefault

Enter the value '1'

You can use the following SQL script to insert the record values to the database:

Copy
INSERT INTO [XMPDB2].[XMPie].[TBL_DELIVERY_PROVIDER_TYPES]
([DeliveryProviderTypeID],
  [DeliveryProviderTypeName],
  [DeliveryProviderTypeAssemblyPath],
  [DeliveryProviderTypeClassName],
  [DeliveryProviderTypeControlName],
  [DeliveryProviderTypeControlAdditionalParams],
  [SendEmailAsTransactionalByDefault])
VALUES
(1000, 
  'Email Composed Sample',
  'EmailComposedPluginSample.dll',
  'EmailComposedPluginSample.EmailComposedSample',
  'DeliveryProviders/EmailComposedSampleUI',
  NULL,
  0)
GO

Verification

  1. In uProduce dashboard, go to the Settings >Delivery Providers tab.

  2. Click New to set up a new delivery provider.

  3. In the Type dropdown list, select Email Composed Sample.

  4. In the Name field, enter a name of a Delivery Provider (for example, Composed Provider). In the SMTP Server field fill in your SMTP server name.

  5. Create an Email Activity and select the new Delivery Provider in the Email Provider dropdown list:

  6. You can now test your new Delivery Provider by sending emails.

Circle synchronization

After adding the new email provider to uProduce, it is immediately available in the uProduce dashboard as you can see in the previous Verification step.

If you are sending emails via Circle, there is a scheduled task that runs at midnight to synchronize the delivery providers listed in Circle. You can either wait overnight for the automated synchronization process to run, or on the uProduce server, open the Windows Task Scheduler and run the XMPEmailProvidersSubscriberListSyncher Task that appears in th Task Scheduler Library.

Template Mode

Overview

The Template mode assumes that the delivery provider knows how to compose the email based on a template and a list of recipients with the ADOR values.

To send emails using the XMPie Email Plug-in in a Template mode, you need to perform the following steps:

  1. Create a user control containing a set of provider-specific parameters (see Template User Control).

  2. Create a plug-in responsible for sending emails (see Template Plug-in).

  3. Update the TBL_DELIVERY_PROVIDER_TYPES table in the XMPDB2 database with the following parameters:

    • The Delivery Provider name

    • The plug-in DLL file name.

    • The Class name

    • The User Control name

  1. Verify your plug-in using the uProduce Dashboard user interface:

    • Create a delivery provider

    • Send an email using this delivery provider.

5. Implement the Tracking add-on (optional).

Template User Control

The User Control is displayed in uProduce Dashboard (Settings>Delivery Providers) and contains the private parameters of the Delivery Provider (for example, SMTP server name, user name, etc.). The entered parameter values are saved to the database and then used when sending emails.

To create a User Control:

  1. Open the Visual Studio and select File > New > Project.

  2. Create a new Visual C# web application. Set its name to EmailSampleUI and click OK.

  3. Add a reference to XMPEmailProviderInterface.dll. The DLL file is located in the uProduce installation folder:

    <Installation Drive>:/XMPie/XMPieExec

  1. Right-click the EmailSampleUI project and select Add > New Item.

  2. Select a Web User Control and name it EmailTemplateSampleUI.ascx and click Add.

  3. Design the user control:

    • From the toolbox, drag a label and set the Text property to Name:.

    • From the toolbox, drag a text box and set the ID property to TextBoxName.

    • From the toolbox, drag a label and set the Text property to Output Folder:.

    • From the toolbox, drag a text box and set the ID property to TextBoxOutputFolder.

    The resulting EmailSampleTemplateUI.ascx file will look as follows:

    Copy
    <%@ Control Language="C#" AutoEventWireup="true"
           CodeBehind="EmailTemplateSampleUI.ascx.cs"
           Inherits="EmailSampleUI.EmailTemplateSampleUI" %>
    <asp:Label ID="Label1" runat="server" Text="Name:"></asp:Label>
    <asp:TextBox ID="TextBoxName" runat="server"></asp:TextBox>
    <br />
    <asp:Label ID="Label2" runat="server" Text="Output folder:"></asp:Label>
    <asp:TextBox ID="TextBoxOutputFolder" runat="server"></asp:TextBox>
  4. Open the EmailTemplateSampleUI.ascx.cs file and add: using EmailProviderExInterface;

  5. 8. Set the class to inherit from IEmailProviderUserControl in addition to the System.Web.UI.UserControl and implement it.

    Below is the sample code for IEmailProviderUserControl interface implementation:

    Copy
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using EmailProviderExInterface;
    namespace EmailSampleUI
    {
      public partial class EmailTemplateSampleUI : System.Web.UI.UserControl,
            IEmailProviderUserControl
      {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        public string DeliveryProviderID { get; set; }
        public string DeliveryProviderParameters { get; set; }
        public string InitControls()
        {
          return null;
        }
        public string Name { get; set; }
        public void PopulateControlValues()
        {
          TextBoxName.Text = Name;
          TextBoxOutputFolder.Text = DeliveryProviderParameters;
          SupportTest = true;
        }
        public void SaveControlValues()
        {
          Name = TextBoxName.Text.Trim();
          DeliveryProviderParameters = TextBoxOutputFolder.Text;
        }
        public bool SupportTest { get; set; }
        public bool Test()
        {
          return true;
        }
        public int TypeID { get; set; }
        public bool ValidatePage()
        {
          return true;
        }
      }
    }
  6. Build the project and copy the EmailSampleUI.dll from the bin folder to \XMPie\XMPieDashboard\bin

  7. Copy the EmailTemplateSampleUI.ascx file to \XMPie\XMPieDashboard\Settings\DeliveryProviders

  8. Edit the \XMPie\XMPieDashboard\PrecompiledApp.config file and ensure that updatable is set to true.

    Note: If you need to change the value to true, for the change to take effect you will need to restart IIS by running iisreset in a command window.

Template Plug-in

Overview

In this sample, we create an email template file and a CSV file containing the recipient information. For each call of the TemplateProcess method, we save each recipient record to the CSV file.

In a real implementation, you might prefer to store in memory a number of recipient records and save them to a CSV file as a batch. Then, you can use the template and the CSV file to send the actual emails.

The Template plug-in implements the email sending process as follows:

  1. uProduce calls the TemplateInitialize method in the beginning of the Send Email job process. This method includes the HTML template parameter to initiate the delivery provider’s resources. In this sample, we save the template as a TXT file.

  2. uProduce calls the TemplateProcess method with ADOR values for each recipient.

  3. uProduce calls the TemplateFinalize method in the end of the job process. Using this method you can send emails to all the recipients in the CSV file.

Plug-In Creation

To create the Template plug-in:

  1. Open the Visual Studio and select File->New->Project.

  2. Create a new Visual C# Class library. Set the class name to EmailTemplatePluginSample and click OK.

  3. Rename the class name from class1.cs to EmailTemplateSample.cs

  4. In the confirmation dialog, click Yes.

  5. Add reference to XMPEmailProviderInterface.dll. The DLL file is located in the uProduce installation folder:

    <Installation Drive>:/XMPie/XMPieExec

  1. Open the EmailTemplateSample.cs file and add: using EmailProviderExInterface;

  1. Set the EmailTemplateSample class to inherit from IEmailTemplateProvider:

    Copy
    public class EmailTemplateSample : IEmailTemplateProvider
    {
    }
  2. Implement the IEmailTemplateProvider interface.

    Below is the sample code for IEmailTemplateProvider interface implementation:

    Copy
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using EmailProviderExInterface;
    using System.IO;
    using System.Text.RegularExpressions;
    namespace EmailTemplatePluginSample
    {
      public class EmailTemplateSample : IEmailTemplateProvider
      {
        private const string CSVFileName = @"EmailList.csv";
        private const string TemplateFileName = @"HTMLTemplate.txt";
        private EmailHeader Header { get; set; }
        private string RootOutputPath { get; set; }
        private string outputPath;
        private string csvOutputFile;
        public void TemplateAbort(EmailAbortEnum inReason)
        {
          // TODO: Add cleanup here
        }
        public void TemplateInitialize(string inEmailProviderParameters,
            EmailProviderSendContext inContext,
            EmailTemplateParameters inParameters,
            AutomaticAdors inAutomaticAdors)
        {
          // TODO: add initialization code here
          RootOutputPath = inEmailProviderParameters;
          outputPath = Path.Combine(RootOutputPath,
              inContext.JobID.ToString());
          if (Directory.Exists(outputPath))
            Directory.Delete(outputPath, true);
          Directory.CreateDirectory(outputPath);
          File.WriteAllText(Path.Combine(outputPath, TemplateFileName),
              inParameters.HTMLTemplateBody);
          Header = inParameters.Header;
          csvOutputFile = Path.Combine(outputPath, CSVFileName);
        }
        public void TemplateProcess(EmailTemplateProcessParameters inParameters)
        {
          try
          {
            StringBuilder row = new StringBuilder();
            if (!File.Exists(csvOutputFile))
            {
              // write the title row
              row.Append("To");
              foreach (string key in inParameters.DynamicObjects.Keys)
              {
                row.Append(",");
                row.Append(key);
              }
              row.Append("\n");
              File.WriteAllText(csvOutputFile, row.ToString());
            }
            row.Clear();
            string toAddress = ComposeString(Header.To[0].Address,
                inParameters.DynamicObjects);
            row.Append(toAddress);
            foreach (string val in inParameters.DynamicObjects.Values)
            {
              row.Append(",");
              row.Append(val);
            }
            row.Append("\n");
            File.AppendAllText(csvOutputFile, row.ToString());
          }
          catch (Exception ex)
          {
            Console.WriteLine("Exception caught in TemplateProcess: {0}",
                ex.ToString());
            throw (new EmailProviderFatalErrorException(ex.Message));
          }
        }
        public void TemplateFinalize()
        {
          // TODO: Add finalization code here
        }
        private string ComposeString(string unComposedString,
              Dictionary<string, string> dynamicObjects)
        {
          string regXMPieAdorAll = AutomaticAdors.XMPIE_DYNAMIC_START_TAG +
               @"\s*(.*?)\s*" + AutomaticAdors.XMPIE_DYNAMIC_END_TAG;
          MatchCollection mc = Regex.Matches(unComposedString, regXMPieAdorAll);
          string composedStr = unComposedString;
          foreach (Match m in mc)
          {
            composedStr = unComposedString.Replace(m.Groups[0].Value,
                 dynamicObjects[m.Groups[1].Value]);
          }
          return composedStr;
        }
        public EmailProviderServices EmailServices { get; set; }
      }
    }
  1. You can test the plug-in using the EmailPluginTest project:

    • Open the EmailPluginTest.cs file and change the parameters:

      Copy
      private const string SMTP_SERVER_NAME = "mySMTPServer";
      private const string TO_EMAIL = "myemail@example.com";
      private const string OUTPUT_FOLDER = @"c:\\output ";
    • Run the EmailTemplatePlugin test method.

  2. Copy the EmailTemplatePluginSample.dll to \XMPie\XMPieExec

Note: In configurations with multiple extension servers, the binary files should be copied to all extensions running email production.

Database Setup

Add a new record to the TBL_DELIVERY_PROVIDER_TYPES table in the XMPDB2 database. This record contains the following columns:

Column

Description

DeliveryProviderTypeID

Enter number > 1000

DeliveryProviderTypeName

name of the plug-in

DeliveryProviderTypeAssemblyPath

Assembly path

DeliveryProviderTypeClassName

Class name

DeliveryProviderTypeControlName

Control name

DeliveryProviderTypeControlAdditionalParams

Leave null

SendEmailAsTransactionalByDefault

Enter the value '1'

You can use the following SQL script to insert the record values to the database:

Copy
INSERT INTO [XMPDB2].[XMPie].[TBL_DELIVERY_PROVIDER_TYPES]
([DeliveryProviderTypeID],
  [DeliveryProviderTypeName],
  [DeliveryProviderTypeAssemblyPath],
  [DeliveryProviderTypeClassName],
  [DeliveryProviderTypeControlName],
  [DeliveryProviderTypeControlAdditionalParams],
  [SendEmailAsTransactionalByDefault])
VALUES
(1001,
  'Email Template Sample',
  'EmailTemplatePluginSample.dll',
  'EmailTemplatePluginSample.EmailTemplateSample',
  'DeliveryProviders/EmailTemplateSampleUI',
  NULL,
  0)
GO

Verification

  1. In uProduce Dashboard, go to the Settings > Delivery Providers tab.

  2. Click New to set up a new delivery provider.

  3. In the Type dropdown list, select Email Template Sample.

  4. In the Name field, enter a name of a Delivery Provider (for example, Template Provider). Set the Output Folder field to any location on your server where you wish to store the CSV and the template files.

  5. Create an Email Activity and select the new Delivery Provider in the Email Provider dropdown list.

  6. You can now test your new Delivery Provider by sending emails. Go to the output directory that you set on the settings page. You will see the CSV and the template files under the Job ID directory.

Circle synchronization

After adding the new email provider to uProduce, it is immediately available in the uProduce dashboard as you can see in the previous Verification step.

If you are sending emails via Circle, there is a scheduled task that runs at midnight to synchronize the delivery providers listed in Circle. You can either wait overnight for the automated synchronization process to run, or on the uProduce server, open the Windows Task Scheduler and run the XMPEmailProvidersSubscriberListSyncher Task that appears in th Task Scheduler Library.

Tracking

Overview

The tracking mechanism is called every hour and allows the Delivery Provider to save events to the Tracking database.

If you want to add the Tracking implementation, you must implement the tracking interface in addition to the email plug-in (Template or Composed).

Plug-in Creation

  1. Set the EmailComposedSample / EmailTemplateSample class to inherit from IEmailTrackingProvider in addition to IEmailComposedProvider / IEmailTemplateProvider.

    Copy
    public class EmailTemplateSample : IEmailTemplateProvider,
                                       IEmailTrackingProvider

    or

    Copy
    public class EmailComposedSample : IEmailComposedProvider,
                                       IEmailTrackingProvider

    Below is the sample code for IEmailTrackingProvider interface implementation:

    Copy
    public bool TrackingInitialize(string inEmailProviderParameters,
                   string inEmailProviderTrackingParameters,
                   EmailProviderTrackingContext inContext)
    {
      return true;
    }
    public bool TrackingProcess(JobTrackingParameters
                  inJobTrackingParameters)
    {
      // get the events from your implementation and add the events to
      // uProduce database using the Email services
      // in the following example, we add open event to one of the
      // recipients.
      // you have to specify the recipient ID or the email address
      EmailServices.EmailTrackingServices.AddEmailOpenedTrackingEvent(
                 inJobTrackingParameters.CampaignID,
                 inJobTrackingParameters.JobID,
                 null,
                 "John.Miller@gmail.com");
      return true;
    }
    public bool TrackingFinalize()
    {
      // TODO: Add finalization code here
      return true;
    }
    public void TrackingAbort(EmailAbortEnum inReason)
    {
      // TODO: Add cleanup here
    }
  1. Copy the EmailTemplatePluginSample.dll / EmailComposedPluginSample.dll with the tracking implementation to \XMPie\XMPieExec

Note: In configurations with multiple extension servers, the binary files should be copied to all extensions running email production.

Verification

The tracking mechanism is called every hour, so you should see the events in the

Tracking database after the task scheduler task execution.