Skip to content

IDAutomation.IntelligentMail

jdubs edited this page Oct 23, 2016 · 1 revision

Table of Contents

Overview

The IntelligentMail barcode option is specified in IDAutomation Barcode Fonts, Components and Applications to create a USPS Intelligent-Mail Customer Barcode, which encodes a string of numbers according to the USPS encoding rules.

Reference

http://www.idautomation.com/barcode/usps-intelligent-mail.html

Parameters

SpecName (constant) The variable containing the input to be converted. Proper UPC font must be applied in the template.

CompleteCode (constant) The entire code to format. When present it is the only consideration for the barcode processing. If not present, the individual components will be combined for processing.

BarcodeIdentifier (constant) 2 digit number: The Barcode Identifier field is a 2-digit field reserved for future use to encode the presort identification that is currently printed in human-readable form on the optional endorsement line (OEL). Initially, OneCodeCONFIRM and OneCodeACS users should leave this field as “00”. Later, the USPS may require the proper coding of this field.

SpecialServices (constant) 3 digit number: The Special Services field is a 3-digit field that identifies the type of service. In the end, the field is intended to allow a single 4CB to support multiple services in addition to or instead of Confirm and ACS.

CustomerIdentifier (constant) 6 digit number: The Customer Identifier field is a 6-digit number identifying the mailer. At the initial launching of 4CB, Destination Confirm appends a leading zero to the assigned 5-digit Subscriber ID to form the Customer Identifier field.

SequenceNumber (constant) The Sequence Number is a 9-digit field. For Destination Confirm, this field holds the existing Mailing ID field, which is a 4- or 6-digit field. The Mailing ID field can be expanded to 9 digits if so desired. Otherwise, leading zeros should be used to fill the field completely. When using Origin Confirm, the Customer Identifier field and the Sequence Number field may be combined into a 15-digit field to hold the existing 9- or 11- digit Customer field plus additional digits. If these fields are not expanded to 15 digits, leading zeros should be used to fill the field completely.

DPBC (constant) The Routing ZIP Code field will accommodate 0, 5, 9 or 11 digit ZIP Code information. Confirm requires a 9- or 11-digit Routing ZIP to serves as "Subscriber ID" for Origin Confirm users. The routing ZIP Code inserted into the 4CB must be registered in the Confirm account.

ErrorMessage (multiple | optional) The error message to return when any error occurs.

Source Code

public static void IntelligentMail(string SpecName, object CompleteCode, object BarcodeIdentifier, object SpecialServices, object CustomerIdentifier, object SequenceNumber, object DPBC, object ErrorMessage)
{
	Actions.Break();
	try
	{
		string code;
		if ((string)CompleteCode != "")
			code = (string)CompleteCode.ToString().Replace("-", "");
		else
			code = String.Format("{0}{1}{2}{3}{4}",
				BarcodeIdentifier,
				SpecialServices,
				CustomerIdentifier,
				SequenceNumber,
				DPBC
			);

		Assembly a = LoadAssembly();

		Type type = a.GetType("IDAutomation.IntelligentMail.IntelligentMail", true, true);
		object instance = Activator.CreateInstance(type);
		MethodInfo m = type.GetMethod("FontEncode");

		Actions.Variable(SpecName).Value = (string)m.Invoke(instance, new[] { code });
	}
	catch (Exception ex)
	{
		throw new Actions.Four51ActionsException(ex.Message, (string)ErrorMessage);
	}
}

Clone this wiki locally