Hi Andy,
Sorry for the delay - been a bit busy these past few days.
This May not be possible unless you have a developer edition because you may not have a BS called UserDefDoc
I create the Word document locally using the <<BS.Attribute>> syntax wherever I need to insert variable data into the doc - and then upload it into UserDefDoc (Example <<Members.Firstname>>)
Now here's the key. You also need an attribute of the document type in the BS that contains the people you want to send to. In my case it is members in your case it might be contacts or customers etc etc. For the sake of understanding my code, mine is called Members.RenewalLetter.
So - before you start the email process, you need to a) select the letter you want to merge and b) transfer the document into the Members record - AND you need to split this into two processes
In my case, I also create the email text and save it in a BS I call BulkMail. This is just for the email text and subject - DON'T attach anything to this email
So now I have my document prepared AND the email text I want to send
So process one would be something like
PICK FROM BulkMail (allows me to select the correct email)
PICK FROM UserDefDoc (allows me to select the correct Word Document
FIND (or PICK FROM) the users/customers/members you want to email to
Then I chain to a second process which must have three BO's listed in the right column for process input - mine are called BulkMail, Members and UserDefDoc. These are all the items that were selected n the previous process and which need to be carried over
The process does:
Members.RenewalLetter=UserDefDoc.UDD_Name THIS IS THE IMPORTANT LINE - and it is important that you use UDD_Name and not any other attribute otherwise all you will get is a document with <<BO.Attribute>> visible and nothing will be merged. This will iterate through the selected contact/members and merge the letter with the data for each contact/member
CREATE BulkText_Renewal WITH BulkText_Renewal.Attachment1=Members.RenewalLetter
SEND BulkText_Renewal TO Members
You have to use CREATE before the send so that you can attach the merged letter to the email. SEND won't do this on its own
Once process 2 completes it will fall back to process one, so I usually put a DISPLAY MESSAGE at the end of process 1 to tell the user everything has finished
BulkText_renewal has the following html code in the Message attribute (set as Standard text)
Dear <<Members.FirstName>>
<<BulkMail.Message>>
<<LoggedInMembers.Firstname>> <<LoggedInMembers.Surname>>
DLGC Office Administrator
General email to all or selected members of the <<SystemSettings.BusinessName>>
Hope this helps. PM me if you need any further advice