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.

Composed

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 in the delivery provider plugin is called every hour by the "XMPEmailProvidersTracker" scheduled task running on the uProduce server. The TrackingProcess method in the plugin allows you to query your custom delivery provider for any tracking events, and to add them to the uProduce Tracking database so that email sends, opens, bounces, and other events are available for tracking together with events from other touchpoints in the cross media campaign.

To add the Tracking capability to your custom email delivery provider plugin, you must implement the tracking interface in addition to the email plug-in (either Template or Composed).

Implement the tracking interface

  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)
    {
        // TODO: Add initialization code here
        return true;
    }

    /// <summary>
    /// The TrackingProcess method is called every hour by the XMPEmailProvidersTracker
    /// scheduled task on the uProduce server. If you wish to add tracking events,
    /// use this method to query your custom email delivery service to get the events
    /// and pass them to the uProduce tracking database.
    /// </summary>
    /// <param name="inJobTrackingParameters"></param>
    /// <returns>Boolean true/false for success/failure</returns>
    public bool TrackingProcess(JobTrackingParameters 
            inJobTrackingParameters)
    {
        foreach (var eventData in QueryYourCustomEmailDeliveryServiceToGetTheEvents(
                inJobTrackingParameters))
        {
            if (eventData["Type"].ToString() == "opened")
            {
                EmailServices.EmailTrackingServices.AddEmailOpenedTrackingEvent(
                        inJobTrackingParameters.CampaignID,
                        inJobTrackingParameters.JobID,
                        null,
                        eventData["Email"].ToString(),
                        Convert.ToDateTime(eventData["DateTime"]));
                continue;
            }

            if (eventData["Type"].ToString() == "failed")
            {
                EmailServices.EmailTrackingServices.AddEmailFailedTrackingEvent(
                        inJobTrackingParameters.CampaignID,
                        inJobTrackingParameters.JobID,
                        null,
                        eventData["Email"].ToString(),
                        eventData["Details"].ToString(),
                        null,
                        Convert.ToDateTime(eventData["DateTime"]));
                continue;
            }

            if (eventData["Type"].ToString() == "unsubscribed")
            {
                EmailServices.EmailTrackingServices.AddEmailUnsubscibedTrackingEvent(
                        inJobTrackingParameters.CampaignID,
                        inJobTrackingParameters.JobID,
                        null,
                        eventData["Email"].ToString(),
                        eventData["Details"].ToString(),
                        null,
                        Convert.ToDateTime(eventData["DateTime"]));
                continue;
            }

            if (eventData["Type"].ToString() == "clicked")
            {
                EmailServices.EmailTrackingServices.AddLinkClickedTrackingEvent(
                        inJobTrackingParameters.CampaignID,
                        inJobTrackingParameters.JobID,
                        null,
                        eventData["Email"].ToString(),
                        eventData["Details"].ToString(),
                        Convert.ToDateTime(eventData["DateTime"]));
                continue;
            }
        }

        return true;
    }

    public bool TrackingFinalize()
    {
        // TODO: Add finalization code here
        return true;
    }

    public void TrackingAbort(EmailAbortEnum inReason)
    {
        // TODO: Add cleanup here
    }

    /// <summary>
    /// Just used for the example of simulating getting events from external system.
    /// In reality the events need to be fetched for specific job\campaign.
    /// Also only events that where not handled before, so no duplicates.
    /// </summary>
    /// <param name="inJobTrackingParameters">The job tracking information to get the events for</param>
    /// <returns>An example list of events</returns>
    private List<Dictionary<string, object>> QueryYourCustomEmailDeliveryServiceToGetTheEvents(
            JobTrackingParameters inJobTrackingParameters)
    {
        return new List<Dictionary<string, object>> {
            new Dictionary<string, object>()
            {
                { "Email",  "john.miller@gmail.com" },
                { "Type", "opened" },
                { "DateTime", DateTime.UtcNow },
                { "Details", null }
            },
            new Dictionary<string, object>()
            {
                { "Email",  "john.miller@gmail.com" },
                { "Type", "unsubscribed" },
                { "DateTime", DateTime.UtcNow },
                { "Details", null }
            },
            new Dictionary<string, object>()
            {
                { "Email",  "jane.doe@gmail.com" },
                { "Type", "failed" },
                { "DateTime", DateTime.UtcNow },
                { "Details", "Hard Bounce" }
            }
        };
    }
  2. 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.

 

EmailProviderExInterface namespace reference

Classes

AutomaticAdors

Special ADOR Objects that can be overridden with Delivery Provider implementation, for example View in browser etc.

Constructors

AutomaticAdors() – Creates a new instance of the AutomaticAdors class.

Fields

Name

CANSPAM_COMPANY_ADDRESS_ADOR

Description

Senders address

Syntax

public const string CANSPAM_COMPANY_ADDRESS_ADOR

 

Name

CANSPAM_COMPANY_CITY_ADOR

Description

Sender's city name

Syntax

public const string CANSPAM_COMPANY_CITY_ADOR

 

Name

CANSPAM_COMPANY_COUNTRY_ADOR

Description

Sender's country

Syntax

public const string CANSPAM_COMPANY_COUNTRY_ADOR

 

Name

CANSPAM_COMPANY_NAME_ADOR

Description

Business name

Syntax

public const string CANSPAM_COMPANY_NAME_ADOR

 

Name

CANSPAM_COMPANY_STATE_ADOR

Description

Sender's state

Syntax

public const string CANSPAM_COMPANY_STATE_ADOR

 

Name

CANSPAM_COMPANY_ZIPCODE_ADOR

Description

Sender's ZIP code

Syntax

public const string CANSPAM_COMPANY_ZIPCODE_ADOR

 

Name

CANSPAM_UNSUBSCRIBE_URL_ADOR

Description

Unsubscribe URL for commercial emails

Syntax

public const string CANSPAM_UNSUBSCRIBE_URL_ADOR

 

Name

VIEW_IN_BROWSER

Description

View in browser link

Syntax

public const string VIEW_IN_BROWSER

 

Name

XMPIE_DYNAMIC_END_TAG

Description

ADOR Object 'End' tag

Syntax

public const string XMPIE_DYNAMIC_END_TAG

 

Name

XMPIE_DYNAMIC_START_TAG

Description

ADOR Object 'Start' tag

Syntax

public const string XMPIE_DYNAMIC_START_TAG

 

Name

XMPIE_RECIPIENT_KEY_ADOR

Description

Recipient Key

Syntax

public const string XMPIE_RECIPIENT_KEY_ADOR

 

Name

XMPIE_RI_PRIMARY_FIELD_ADOR_MAX_LENGTH

Description

Maximum length of the Recipient Key ADOR

Syntax

public const int XMPIE_RI_PRIMARY_FIELD_ADOR_MAX_LENGTH

Properties

Name

AutomaticAdorsDict

Description

The dictionary containing ADOR Objects

Syntax

public Dictionary<string, string> AutomaticAdorsDict { get; }

EmailAddress

Constructors

EmailAddress() – Initializes a new instance of the EmailAddress class.

EmailAddress(EmailAddress) - Initializes a new instance of the EmailAddress class using the specified address.

Properties

Name

Address

Description

Email address

Syntax

public string Address { get; set; }

 

Name

Display

Description

Email address display name

Syntax

public string Display { get; set; }

EmailComposedParameters

Composed parameters - for future use.

EmailComposedProcessParameters

Composed process parameters. This class contains email message data, such as recipient ID, header, message body, etc.

Constructors

EmailComposedParameters() – Initializes a new instance of the EmailComposedParameters class

Properties

Name

Header

Description

Email header

Syntax

public EmailHeader Header { get; set; }

 

Name

HTMLComposedBody

Description

Composed HTML message body

Syntax

public string HTMLComposedBody { get; set; }

 

Name

RecipientID

Description

Recipient ID

Syntax

public string RecipientID { get; set; }

 

Name

TEXTComposedBody

Description

Composed Text message body

Syntax

public string TEXTComposedBody { get; set; }

EmailDynamicObjectInformation

Dynamic object type and information

Constructors

EmailDynamicObjectInformation() – Initializes a new instance of the EmailDynamicObjectInformation class

Properties

Name

DynamicObjectType

Description

Dynamic object type

Syntax

public EmailDynamicObjectTypeEnum DynamicObjectType { get; set; }

EmailDynamicObjectInformation_Tabular

Dynamic object type and information – tabular

Constructors

EmailDynamicObjectInformation_Tabular() - Initializes a new instance of the EmailDynamicObjectInformation_Tabular class

Fields

Name

TABULAR_COL_DELIMITER

Description

delimiter for tabular column

Syntax

public const string TABULAR_COL_DELIMITER

 

Name

TABULAR_ROW_DELIMITER

Description

delimiter for tabular row

Syntax

public const string TABULAR_ROW_DELIMITER

Properties

Name

ColumnNameList

Description

Tabular column names

Syntax

public List<string> ColumnNameList 
{ get; set; }

 

Name

DynamicObjectType

Description

Dynamic object type (Inherited from EmailDynamicObjectInformation)

Syntax

public EmailDynamicObjectTypeEnum DynamicObjectType { get; set; }

EmailGeneralParameters

General email parameters

Constructors

EmailGeneralParameters() - Initializes a new instance of the EmailGeneralParameters class

Properties

Name

Header

Description

Email header

Syntax

public EmailHeader Header { get; set; }

EmailHeader

Email header

Constructors

EmailHeader() - Initializes an empty instance of the EmailHeader class.

EmailHeader(EmailHeader) - Initializes an empty instance of the EmailHeader class by using the specified EmailHeader class objects.

Properties

Name

BCC

Description

The list of email addresses of all the blind carbon copy (BCC) recipients.

Syntax

public EmailAddress[] BCC { get; set; }

 

Name

CC

Description

The list of email addresses of all the carbon copy (CC) recipients.

Syntax

public EmailAddress[] CC { get; set; }

 

Name

CharacterSet

Description

The email message body encoding.

Syntax

public string CharacterSet { get; set; }

 

 

Name

From

Description

The 'From' address of the email message.

Syntax

public EmailAddress From { get; set; }

 

Name

ReplyTo

Description

The 'ReplyTo' address of the email message.

Syntax

public EmailAddress[] ReplyTo { get; set; }

 

 

Name

Subject

Description

The email message subject line.

Syntax

public string Subject { get; set; }

 

Name

To

Description

The list of email addresses of all email recipients.

Syntax

public EmailAddress[] To { get; set; }

EmailProviderBaseException

Email Delivery Provider exception. If the Delivery Provider encounters an error, it can return an exception to stop the email process.

Constructors

EmailProviderBaseException() - Email Provider Base Exception

EmailProviderBaseException(String) - Email Provider Base Exception with string message.

Syntax

public EmailProviderBaseException()
public EmailProviderBaseException(
  string message
)

EmailProviderContext

uProduce data that can be used by the Delivery provider to perform various operations

Constructors

EmailProviderContext() - Initializes a new instance of the EmailProviderContext class

Fields

Name

EmailContextProperty_EstimatedRecordCount

Description

Estimated record count

Syntax

public const string EmailContextProperty_EstimatedRecordCount

 

Name

EmailContextProperty_IsComposedBody

Description

'True' if the email message body is created using the URL mechanism or a template.

Syntax

public const string EmailContextProperty_IsComposedBody

 

Name

EmailContextProperty_IsLinksClicksTracked

Description

'True' if the links clicks in the email body are tracked.

Syntax

public const string EmailContextProperty_IsLinksClicksTracked

 

 

Name

EmailContextProperty_IsTrackedJob

Description

'True' if the job is tracked.

Syntax

public const string EmailContextProperty_IsTrackedJob

 

Name

EmailContextProperty_JobOutputFolder

Description

Job output folder.

Syntax

public const string EmailContextProperty_JobOutputFolder

 

 

Name

EmailContextProperty_MachineID

Description

Machine ID - unique ID of the current uProduce server

Syntax

public const string EmailContextProperty_MachineID

 

Name

EmailContextProperty_OldMachineID

Description

Obsolete - old Machine ID

Syntax

public const string EmailContextProperty_OldMachineID

 

Name

EmailContextProperty_TouchPointGUID

Description

TouchPoint Guid - unique GUID of the touch point

Syntax

public const string EmailContextProperty_TouchPointGUID

 

Name

EmailContextProperty_uProduceSystemID

Description

System ID - unique ID of the current uProduce server

Syntax

public const string EmailContextProperty_uProduceSystemID

Properties

Name

CustomerID

Description

Customer ID

Syntax

public int CustomerID { get; set; }

 

Name

CustomerName

Description

Customer name

Syntax

public string CustomerName { get; set; }

 

Name

EmailContextProperties

Description

A dictionary of additional email contexts, for example, email type (commercial or transactional)

Syntax

public Dictionary<string, string> EmailContextProperties { get; set; }

 

Name

EmailProviderID

Description

Delivery provider ID

Syntax

public int EmailProviderID { get; set; }

 

Name

EmailProviderName

Description

Delivery provider name

Syntax

public string EmailProviderName { get; set; }

 

Name

Proxy

Description

Proxy information

Syntax

public ProxyInfo Proxy { get; set; }

EmailProviderFatalErrorException

Email Delivery Provider fatal error exception. This exception stops the email send process.

Constructors

EmailProviderFatalErrorException() - Email Provider Fatal Error Exception

EmailProviderFatalErrorException(string) - Email Provider Fatal Error Exception with string message

EmailProviderProcessException

Email Provider Process Exception. This exception stops the email send process for the current recipient. The sending operation will continue for all the other recipients.

Constructors

EmailProviderProcessException() - Email Provider Process Exception

EmailProviderProcessException(String) - Email Provider Process Exception with string message

EmailProviderSendContext

uProduce send data that can be used by the Delivery Provider to perform various tracking operations

Constructors

EmailProviderSendContext() - Initializes a new instance of the EmailProviderSendContext class

Properties

Name

AccountID

Description

Account ID

Syntax

public int AccountID { get; set; }

 

Name

AccountName

Description

Account name

Syntax

public string AccountName { get; set; }

 

Name

CampaignID

Description

Campaign ID

Syntax

public int CampaignID { get; set; }

 

 

Name

CampaignName

Description

Campaign name

Syntax

public string CampaignName { get; set; }

 

Name

CustomerID

Description

Customer ID (Inherited from EmailProviderContext.)

Syntax

public int CustomerID { get; set; }

 

Name

CustomerName

Description

Customer name (Inherited from EmailProviderContext.)

Syntax

public string CustomerName { get; set; }

 

Name

EmailContextProperties

Description

A dictionary of additional email contexts, for example, email type (commercial or transactional) (Inherited from EmailProviderContext.)

Syntax

public Dictionary<string, string> EmailContextProperties { get; set; }

 

Name

EmailProviderID

Description

Delivery Provider ID (Inherited from EmailProviderContext.)

Syntax

public int EmailProviderID { get; set; }

 

Name

EmailProviderName

Description

Delivery Provider name (Inherited from EmailProviderContext.)

Syntax

public string EmailProviderName { get; set; }

 

Name

JobID

Description

Job ID

Syntax

public int JobID { get; set; }

 

Name

JobName

Description

Job name

Syntax

public string JobName { get; set; }

 

 

Name

JobType

Description

Job type

Syntax

public JobTypeEnum JobType { get; set; }

 

Name

Proxy

Description

Proxy information (Inherited from EmailProviderContext.)

Syntax

public ProxyInfo Proxy { get; set; }

 

Name

PublicationID

Description

(For future use) The publication list ID. If 0, the Account ID will be used instead.

Syntax

public int PublicationID { get; set; }

EmailProviderServices

A set of utilities that can be used by the Delivery Provider, for example, to attach a message to the uProduce job.

Constructors

EmailProviderServices() - Initializes a new instance of the EmailProviderServices class

Methods

Name

ReportJobMessage

Description

This method allows to report a message and attach it to the uProduce Job. This message can be viewed in the uProduce Dashboard Job Center.

Syntax

public bool ReportJobMessage(
	int inJobID,
	EmailProviderServices.JobMessageSeverity inSeverity,
	string inMessage
)

 

Name

ReportJobProgress

Description

This method allows to report progress message and attach it to the uProduce Job. This message can be viewed in the uProduce Dashboard Job Center.

Syntax

public bool ReportJobProgress(
	int inJobID,
	string inMessage
)

Properties

Name

EmailSubscriberListServices

Description

A set of email Subscriber List helper utilities that the Delivery Provider can use to display a message or to update tracking parameters.

Syntax

public EmailProviderServices.EmailProviderSubscriberListServices EmailSubscriberListServices { get; }

 

Name

EmailTrackingServices

Description

A set of email helper utilities that the Delivery Provider

can use to display a message or to update tracking parameters.

Syntax

public EmailProviderServices.EmailProviderTrackingServices EmailTrackingServices { get; }

EmailProviderServices.EmailProviderSubscriberListServices

Email Provider Subscriber List Services

Constructor

EmailProviderSubscriberListServices() - Initializes a new instance of the EmailProviderServices.EmailProviderSubscriberListServices class

Methods

Name

GetEmailProviderSubscriberListID

Description

Get Email Provider subscriber list ID

Syntax

public string GetEmailProviderSubscriberListID(
	int inEmailProviderID,
	int inAccountID,
	Nullable<int> inPublicationID
)

 

Name

SyncEmailProviderSubscriberStatus

Description

Synchronize Email Provider Subscriber Status

Syntax

public bool SyncEmailProviderSubscriberStatus(
	string inEmailAddress,
	int inAccountID,
	bool inIsActive,
	Nullable<DateTime> inUnsubscribedDate,
	string inUnsubscribedReason,
	Nullable<DateTime> inResubscribedDate,
	string inCustomData
)

EmailProviderServices.EmailProviderTrackingServices

Email provider tracking services

Constructor

EmailProviderTrackingServices() - Initializes a new instance of the EmailProviderServices.EmailProviderTrackingServices class

Methods

Name

AddEmailFailedTrackingEvent

Description

Adds the 'Failed' tracking event to the database.

Syntax

public bool AddEmailFailedTrackingEvent(
	int inCampaignID,
	int inJobID,
	string inRecipientID,
	string inEmailAddress,
	string inFailureType,
	string inAdditionalInfo,
	Nullable<DateTime> inUtcDate,
	string inEmailProviderEventID,
	bool inIgnoreIfExist
)

 

Name

AddEmailOpenedTrackingEvent

Description

This method adds the 'Opened' tracking event to the database.

Syntax

public bool AddEmailOpenedTrackingEvent(
	int inCampaignID,
	int inJobID,
	string inRecipientID,
	string inEmailAddress,
	Nullable<DateTime> inUtcDate,
	string inEmailProviderEventID,
	bool inIgnoreIfExist
)

 

Name

AddEmailTrackingEvent

Description

Adds a custom 'Tracking' event to the database.

Syntax

public bool AddEmailTrackingEvent(
	int inCampaignID,
	int inJobID,
	string inEventType,
	string inRecipientID,
	string inEmailAddress,
	Nullable<DateTime> inUtcDate,
	string inEmailProviderEventID,
	bool inIgnoreIfExist,
	EmailProviderServices
		.EmailProviderTrackingServices
		.TrackingEventProperty[] inProperties
)

 

Name

AddEmailUnsubscibedTrackingEvent

Description

Adds the 'Unsubscribed' tracking event to the database.

Syntax

public bool AddEmailUnsubscibedTrackingEvent(
	int inCampaignID,
	int inJobID,
	string inRecipientID,
	string inEmailAddress,
	string inUnsubscribeType,
	string inAdditionalInfo,
	Nullable<DateTime> inUtcDate,
	string inEmailProviderEventID,
	bool inIgnoreIfExist
)

 

Name

AddLinkClickedTrackingEvent

Description

This method adds the 'Email Link Clicked' tracking event to the database.

Syntax

public bool AddLinkClickedTrackingEvent(
	int inCampaignID,
	int inJobID,
	string inRecipientID,
	string inEmailAddress,
	string inURL,
	Nullable<DateTime> inUtcDate,
	string inEmailProviderEventID,
	bool inIgnoreIfExist
)

 

Name

UpdateEmailProviderTrackingParameters

Description

Updates the Delivery Provider's tracking parameters.

Syntax

public bool UpdateEmailProviderTrackingParameters(
	int inEmailProviderID,
	string inParameters
)

 

Name

UpdateJobTrackingParameters

Description

Updates the Job tracking parameters.

Syntax

public bool UpdateJobTrackingParameters(
	int inJobID,
	int inEmailProviderID,
	string inParameters
)

EmailProviderServices.EmailProviderTrackingServices.TrackingEventProperty

Tracking event property - used to specify additional information about the Tracking event.

Constructors

TrackingEventProperty() - Initializes a new instance of the EmailProviderServices.EmailProviderTrackingServices.TrackingEventProperty class

Properties

Name

Name

Description

The name of the property

Syntax

public string Name { get; set; }

 

Name

Value

Description

The value of the property

Syntax

public string Value { get; set; }

EmailProviderTrackingContext

Produce tracking data that can be used by the Delivery Provider to perform various tracking operations

Constructors

EmailProviderTrackingContext() - Initializes a new instance of the EmailProviderTrackingContext class

Properties

Name

CustomerID

Description

Customer ID (Inherited from EmailProviderContext.)

Syntax

public int CustomerID { get; set; }

 

Name

CustomerName

Description

Customer name (Inherited from EmailProviderContext.)

Syntax

public string CustomerName { get; set; }

 

Name

EmailContextProperties

Description

A dictionary of additional email contexts, for example, email type (commercial or transactional) (Inherited from EmailProviderContext.)

Syntax

public Dictionary<string, string> EmailContextProperties { get; set; }

 

Name

EmailProviderID

Description

Delivery Provider ID (Inherited from EmailProviderContext.)

Syntax

public int EmailProviderID { get; set; }

 

Name

EmailProviderName

Description

Delivery Provider name (Inherited from EmailProviderContext.)

Syntax

public string EmailProviderName { get; set; }

 

Name

Proxy

Description

Proxy information (Inherited from EmailProviderContext.)

Syntax

public ProxyInfo Proxy { get; set; }

EmailTemplateParameters

Email Template parameters

Constructors

EmailTemplateParameters() - Initializes a new instance of the EmailTemplateParameters class

Properties

Name

DynamicObjectsType

Description

Dynamic Objects Types - the type of each ADOR - can be text, visibility, tabular, style etc.

Syntax

public Dictionary<string, IEmailDynamicObjectInformation> DynamicObjectsType { get; set; }

 

Name

Header

Description

Header

Syntax

public EmailHeader Header { get; set; }

 

Name

HTMLTemplateBody

Description

HTML template body

Syntax

public string HTMLTemplateBody { get; set; }

 

Name

TEXTTemplateBody

Description

Text template body

Syntax

public string TEXTTemplateBody { get; set; }

EmailTemplateProcessParameters

Email Template process parameters

Constructors

EmailTemplateProcessParameters() - Initializes a new instance of the EmailTemplateProcessParameters class

Properties

Name

DynamicObjects

Description

ADOR Objects dictionary

Syntax

public Dictionary<string, string> DynamicObjects { get; set; }

 

Name

RecipientID

Description

Recipient ID

Syntax

public string RecipientID { get; set; }

JobTrackingParameters

Job tracking parameters

Constructors

JobTrackingParameters() - Initializes a new instance of the JobTrackingParameters class

Properties

Name

CampaignID

Description

Campaign ID

Syntax

public int CampaignID { get; set; }

 

Name

EmailProviderParameters

Description

Delivery provider parameters

Syntax

public string EmailProviderParameters { get; set; }

 

Name

JobID

Description

Job ID

Syntax

public int JobID { get; set; }

ProxyInfo

Proxy information

Constructors

ProxyInfo() - Initializes a new instance of the ProxyInfo class

Properties

Name

FtpPort

Description

The FTP port number

Syntax

public int FtpPort { get; set; }

 

Name

FtpServer

Description

The FTP server name

Syntax

public string FtpServer { get; set; }

 

Name

HttpPort

Description

The HTTP port number

Syntax

public int HttpPort { get; set; }

 

Name

HttpServer

Description

The HTTP server name

Syntax

public string HttpServer { get; set; }

 

Name

HttpsPort

Description

The HTTPS port number

Syntax

public int HttpsPort { get; set; }

 

Name

HttpsServer

Description

The HTTPS server name

Syntax

public string HttpsServer { get; set; }

Interfaces

IEmailComposedOnDemandProvider

Composed On-Demand Provider Interface. The Delivery Provider wishing to use different implementations for batch and On-Demand email send can implement the IEmailComposedOnDemandProvider interface in addition to the IEmailComposedProvider interface.

Methods

Name

ComposedAbort

Description

The Abort method is called when an error occurs. This method allows the Delivery Provider implementation to clean up and close resources, if needed.

Syntax

void ComposedAbort(
	EmailAbortEnum inReason
)

 

Name

ComposedFinalize

Description

The Finalize method is called only once at the end of the email send process.

Syntax

void ComposedFinalize()

 

Name

ComposedInitialize

Description

The Initialize method is called only once when the plug-in is loaded to allow the Delivery Provider implementation to initialize its resources.

Syntax

void ComposedInitialize(
	string inEmailProviderParameters,
	EmailProviderSendContext inContext,
	EmailComposedParameters inParameters,
	ref AutomaticAdors inoutAutomaticAdors
)

 

Name

ComposedOnDemandProcess

Description

The Process method is called for the On Demand recipient. The Delivery Provider implementation should send an email to this recipient.

Syntax

void ComposedOnDemandProcess(
	EmailComposedProcessParameters inParameters
)

IEmailComposedProvider interface

Composed Delivery Provider Interface. This interface can be used when working with Delivery Providers that do not support email composition from a template. These Delivery Providers can only send pre-composed email messages.

Methods

Name

ComposedAbort

Description

The Abort method is called when an error occurs during the email send process or when a user decides to abort the process. This method allows the Delivery provider to clean up and close its resources if needed.

Syntax

void ComposedAbort(
	EmailAbortEnum inReason
)

 

Name

ComposedFinalize

Description

The Finalize method is called only once at the end of the email send process.

Syntax

void ComposedFinalize()

 

Name

ComposedInitialize

Description

The ComposedInitialize method is called only once when the plug-in is loaded to allow the Delivery Provider implementation to initialize its resources.

Syntax

void ComposedInitialize(
	string inEmailProviderParameters,
	EmailProviderSendContext inContext,
	EmailComposedParameters inParameters,
	ref AutomaticAdors inoutAutomaticAdors
)

 

Name

ComposedProcess

Description

The Process method is called for every recipient. The Delivery Provider can send an email for each recipient, or save the recipient data and send email batches instead.

Syntax

void ComposedProcess(
	EmailComposedProcessParameters inParameters
)

Properties

Name

EmailServices

Description

Email services - a set of utilities that can be used by the Delivery Provider, for example, to attach a message to the uProduce job. (Inherited from IEmailProvider.)

Syntax

EmailProviderServices EmailServices { get; set; }

IEmailDynamicObjectInformation

Dynamic object type and information

Properties

Name

DynamicObjectType

Description

Dynamic object type

Syntax

EmailDynamicObjectTypeEnum DynamicObjectType { get; set; }

IEmailProvider

Email Provider Interface. This is the base class for the XMPie Email Interfaces.

Properties

Name

EmailServices

Description

Email services - a set of utilities that can be used by the Delivery Provider, for example, to attach a message to the uProduce job.

Syntax

EmailProviderServices EmailServices { get; set; }

IEmailProviderCustomAction

Used to communicate between the GUI - Provider user control and the provider dll. can be used to validate parameters, email verification etc.

Methods

Name

CustomActionInitialize

Description

The Initialize method is called only once when the plug-in is loaded to allow the Delivery Provider implementation to initialize its resources.

Syntax

void CustomActionInitialize(
	EmailProviderSendContext context,
	string inEmailProviderParameters
)

 

Name

DoAction

Description

Action to be called from the GUI - (The provider user control)

Syntax

string DoAction(
	string action,
	string actionParams
)

IEmailProviderUserControl

Email Provider User Control. This class is used to implement the Delivery Provider Settings 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.).

Methods

Name

InitControls

Description

Allows the Delivery Provider implementation to initialize the controls in the user control.

Syntax

string InitControls()

 

Name

PopulateControlValues

Description

Allows the Delivery Provider to populate the control values in the User Control.

Syntax

void PopulateControlValues()

 

Name

SaveControlValues

Description

Allows the Delivery Provider to save the control's values.

Syntax

void SaveControlValues()

 

Name

Test

Description

If the Delivery Provider supports the Email Test option, this function is called when the user clicks the Test button in the New/Edit Delivery Provider window in uProduce Dashboard.

Syntax

bool Test()

 

Name

ValidatePage

Description

Allows the Delivery Provider to validate the Delivery Provider Settings page before saving.

Syntax

bool ValidatePage()

Properties

Name

DeliveryProviderID

Description

Delivery Provider ID

Syntax

string DeliveryProviderID { get; set; }

 

Name

DeliveryProviderParameters

Description

Delivery Provider private parameters

Syntax

string DeliveryProviderParameters { get; set; }

 

Name

Name

Description

Delivery Provider Name

Syntax

string Name { get; set; }

 

Name

SupportTest

Description

This property returns 'True' if the Delivery Provider implements the 'Test' option. The 'Test' option allows to test the email sending for a single email address. In uProduce Dashboard, the Test button is available in the Edit/New Delivery Provider window.

Syntax

bool SupportTest { get; set; }

 

Name

TypeID

Description

Delivery Provider Type ID. In custom implementations the ID values start from 1000.

Syntax

int TypeID { get; set; }

IEmailTemplateOnDemandProvider

Template On Demand Provider Interface. The Delivery Provider wishing to use different implementations for batch and On Demand email send, can implement the IEmailTemplateOnDemandProvider interface in addition to the IEmailTemplateProvider interface.

Methods

Name

TemplateAbort

Description

The Abort method is called when an error occurs. This method allows the Delivery Provider implementation to clean up and close resources, if needed

Syntax

void TemplateAbort(
	EmailAbortEnum inReason
)

 

Name

TemplateFinalize

Description

The Finalize method is called only once at the end of the email send process.

Syntax

void TemplateFinalize()

 

Name

TemplateInitialize

Description

The Initialize method is called only once when the plug-in is loaded to allow the Delivery Provider implementation to initialize its resources.

Syntax

void TemplateInitialize(
	string inEmailProviderParameters,
	EmailProviderSendContext inContext,
	EmailTemplateParameters inParameters,
	AutomaticAdors inAutomaticAdors
)

 

Name

TemplateOnDemandProcess

Description

The Process method is called for the On Demand recipient. The Delivery Provider implementation should send an email to this recipient.

Syntax

void TemplateOnDemandProcess(
	EmailTemplateProcessParameters inParameters
)

Properties

Name

EmailService

Description

Email services - a set of utilities that can be used by the Delivery Provider, for example, to attach a message to the uProduce job. (Inherited from IEmailProvider.)

Syntax

EmailProviderServices EmailServices { get; set; }

IEmailTemplateProvider

Email Template Delivery Provider. The Template plug-in can be used by Delivery Providers that know how to compose the email from a template and a list of recipients with ADOR values.

Methods

Name

TemplateAbort

Description

The Abort method is called when an error occurs. This method allows the Delivery Provider implementation to clean up and close resources, if needed.

Syntax

void TemplateAbort(
	EmailAbortEnum inReason
)

 

Name

TemplateFinalize

Description

The Finalize method is called only once at the end of the email send process.

Syntax

void TemplateFinalize()

 

Name

TemplateInitialize

Description

The Initialize method is called only once when the plug-in is loaded to allow the Delivery Provider implementation to initialize its resources.

Syntax

void TemplateInitialize(
	string inEmailProviderParameters,
	EmailProviderSendContext inContext,
	EmailTemplateParameters inParameters,
	AutomaticAdors inAutomaticAdors
)

 

Name

TemplateProcess

Description

The Process method is called for the On Demand recipient. The Delivery Provider implementation should send an email to this recipient.

Syntax

void TemplateProcess(
	EmailTemplateProcessParameters inParameters
)

Properties

Name

EmailServices

Description

Email services - a set of utilities that can be used by the Delivery Provier, for example, to attach a message to the uProduce job. (Inherited from IEmailProvider.)

Syntax

EmailProviderServices EmailServices { get; set; }

IEmailTrackingProvider

Tracking provider. This interface allows the Delivery Provider to add tracking events to the uProduce database. The Tracking implementation is called every hour in order to update the tracked events using the EmailServices API.

Methods

Name

TrackingAbort

Description

The Abort method is called when an error occurs. This method allows the Delivery Provider to clean up and close resources, if needed.

Syntax

void TrackingAbort(
	EmailAbortEnum inReason
)

 

Name

TrackingFinalize

Description

The Finalize method is called only once at the end of the email process.

Syntax

bool TrackingFinalize()

 

Name

TrackingInitialize

Description

The Initialize method is called to initalize Delivery Provider's resources.

Syntax

bool TrackingInitialize(
	string inEmailProviderParameters,
	string inEmailProviderTrackingParameters,
	EmailProviderTrackingContext inContext
)

 

Name

TrackingProcess

Description

The Process method is called to allow the Delivery Provider to update the tracking events.

Syntax

bool TrackingProcess(
	JobTrackingParameters inJobTrackingParameters
)

Properties

Name

EmailServices

Description

Email services - a set of utilities that can be used by the Delivery Provider, for example, to attach a message to the uProduce job. (Inherited from IEmailProvider.)

Syntax

EmailProviderServices EmailServices { get; set; }

Enumerations

EmailAbortEnum

Abort reason values

Members

FatalError

AbortRequest

EmailDynamicObjectTypeEnum

Dynamic object types

Members

Text

TextFile

Graphic

Link

Visibility

Style

Tabular

EmailMessagesTypeEnum

Report message type values

Members

IllegalAddress

Unknown

EmailProviderServices.JobMessageSeverity

Job message severity values: Error, Warning or Information

Members

Error

Warning

Information

JobTypeEnum

Job type values

Members

Send

Test

Preflight

Port

OnDemand

TestProvider