Dovetail Email Agent now supports a plug-in for custom contact validation when creating a case in freeForm mode. This allows customers to add custom validation code to validate whether a contact is allowed to create a case or not.
For example, a customer may wish to only allow cases to be created by contacts with a valid support contract. Or only allow case creation if the primary site of the contact is of a certain type, such as CUST, but not VEND. This plug-in model enables a robust, customizable extension point to Dovetail Email Agent.
To implement this functionality:
Create a .NET class (in any .NET language: C#, VB.NET, etc) which implements the IFreeFormContactValidator interface which is located in the Dovetail.Sec.Core assembly/DLL (which is installed to your Dovetail Email Agent installation folder) and then compile the new custom .NET class to an assembly/DLL.
Copy this DLL to the Dovetail Email Agent install directory (C:\Program Files\Dovetail Software\Email Agent)
Modify email-agent-config.xml, adding a new parameter for the freeFormContactValidatorType. The value should be the fully qualified type name (see note 1 below) of your new .NET class/type and assembly. Example: <param name="freeFormContactValidatorType" value="MyCompany.SecExtension.Core.ContactValidator, MyCompany.SecExtension.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
In the future, when upgrading Dovetail Email Agent to a newer version, it will be necessary to create a 'binding redirection' for .NET to redirect the custom .NET class' dependency on the Dovetail.Sec.Core assembly from the previous version to the latest version. See below for details (see note 3 below).
Start the Dovetail Email Agent service
If the validator returns true, then a case will be created.
NOTE 1: The rules for 'fully qualified type name' can be found in the MSDN .NET Developer Center under the topic "Type.GetType Method (String)".
NOTE 2: If your custom implementation of the IFreeFormContactValidator interface uses the Dovetail SDK or the FChoice.Common assemblies, you must reference the SAME Dovetail SDK and/or FChoice.Common versions that the installed Dovetail Email Agent version is using. If using assembly binding redirection (mentioned below), and the newer version of Dovetail Email Agent references a newer version of the Dovetail SDK also, assembly binding redirection will not be sufficient and a recompile of your custom implementation will be required.
NOTE 3: If you build a custom implementation of the IFreeFormContactValidator interface which was based off the Dovetail.Sec.Core version 1.1.0.3, and later you upgrade your Dovetail Email Agent installation to 1.1.1.15, you will not have to rebuild your custom implementation to work with the new Dovetail Email Agent due to a feature of the .NET CLR known as 'assembly binding redirection'. In the EmailAgentService.exe.config file, at the bottom, just before the </configuration> closing XML tag, you will need to add this XML:
IMPORTANT: Remember to change the 'oldVersion' and the 'newVersiion' accordingly where oldVersion is the Dovetail.Sec.Core assembly version against which your custom IFreeFormContactValidator was build and newVersion is the Dovetail.Sec.Core assembly version currently installed.
IMPORTANT: Check the version history notes in future Dovetail Email Agent releases. It may be necessary for Dovetail Software to break compatibility in the IFreeFormContactValidator interface which would require you to rebuild your custom implementation (binding redirection would not be sufficient in this case). In the event that binary compatibility is broken, there will be a WARNING note in the version history alerting you to this fact.