Introduction

Spindle Document Distrinution allows you to specify an use multiple email addresses to distribute your documents. We can use the fact that email servers will split the TO:, CC: and BCC: fields into separate addresses if separated by a semi-colon.

The simplest way, which would require no additional configuration is to add multiple addresses into the contact field in the ERP, so your contact email address would be, for example: "alice@test.com; bob@test.com". However this method is inflexible and difficult to maintain. 


Instead, you can use additional fields from the ERP to hold the additional email addresses. These fields need to be available on the document that is to be distributed.

Let's say you have three fields in the ERP containg the following addresses for the four customers below:
CustomerABC001DEF001GHI001JKL001
Email1alice@abc.test.comdiana@def.test.comgaynor@ghi.test.comjulius@jkl.test.com
Email2bob@abc.test.comedward@def.test.com
Email3charlie@abc.test.comingrid@ghi.test.com


Method 1

Add multiple emails inside ##EMAIL....##

You can build an expression that concatenates the email address fields with a semi-colon separating them, such as:


"##EMAIL " & Email1 & ";" & Email2 & ";" & Email3 & "##"


Which would give the following results


ABC001: ##EMAIL alice@abc.test.com; bob@abc.test.com; charlie@abc.test.com##

DEF001: ##EMAIL diana@def.test.com; edward@def.test.com; ##

GHI001: ##EMAIL gaynor@ghi.test.com; ; ingrid@ghi.test.com##

JKL001: ##EMAIL julius@jkl.test.com; ; ##


Spindle Document Distribution will place each of these into the TO: field of the outgoing email, and any 'empty' addresses will be ignored.

Method 2

Add additional email addresses to their own variable

Identify unused ##VARnn...## commands to use. In the examples below I will use ##VAR10...## and ##VAR11...##.


Assuming that ##EMAIL...## is already present, add two further expressions to hold the second and thrid email addresses, for example: 


"##EMAIL " & Email1 & "##"
"##VAR10 " & Email2 & "##"
"##VAR11 " & Email3 & "##"


You can now specify whether the additional emails are to be placed in the TO: CC: or BCC: fields of the email. 


To do this, open Spindle Document Distribution Tools, and navigate to the Document Operation, then under Email Settings>Details and check the box for "Send email to these recipients"click to Add a recipient:


Select the recipient type (TO:/CC:/BCC:) and under Address, enter the appropriate command as configured on the document layout, for example:

repeat for the remaining email addresses.


Ensure that "Send to original recipient" is checked, this includes the address set in ##EMAIL...## in the email.

With the above setup, an email to ABC001 would be emailed


TO: Alice@abc.test.com

CC: Bob@abc.test.com

BCC: Charlie@abc.test.com


Use External Data

If the additional email addresses cannot be placed onto the document to be printed, but an analysis code that can be used as a lookup can, then you can use Spindle Document Distribution's External Data functionality to retrieve the email address from another ERP table, a separately held Access database or any other data source accessible using ODBC drivers - see the article 

KBA-01-02-005 - External Data for more details


Knowledge Base Article Details

Related ProductSpindle Document Distribution, Spindle Professional
Reference NumberKBA-01-02-033
Document Date12/11/2024
Original AuthorVince Hodgson
Document Version1.0
Last Updated12/11/2024
Update AuthorVince Hodgson