Problems Generating email for multiple people

Hi all,

I’m stumped and I don’t know how to fix my issue. So let me explain. I have a agent in LS which runs to dispatch tickets. During the dispatching it will generate an email to the requester…This part works. If the requester opened a ticket for multiple users, during the filling out of the form from the requester they put all the user’s name in the form. This is captured by field RefUsers.

When the script runs if the RefUser is populated then it will generate an email and send it everyone listed.

The issue is I cannot get the email to send to all listed in the field. Only the first person is captured. I tried this a tester form and it worked. I have a feeling that it’s because this agent is running as a class, where everything is Me.

Here is the coding for the email portion for RefUsers:

Now the recipients string has declared at the beginning of the script. The declaration was:

Dim recipients( 1 To 5 ) As String

'RefUser is checked and tallyed to include all users.

Dim getdata As Variant

Dim n

getdata = Me.m_ardoc.RefUser

Forall gd In getdata

n = n + 1

recipients(n) = gd

End Forall

'configuring fields on email doc

sendDoc.CopyTo = Me.m_ardoc.AssignedTo_1(0)

sendDoc.Person = recipients

sendDoc.Subject = “Technical Request has been recieved”

sendDoc.HDTicket = Me.m_ardoc.HDTicket

sendDoc.OrgTech = Me.m_ardoc.AssignedTo_1

sendDoc.ProblemCat = Me.m_ardoc.ProblemCat

sendDoc.ProblemSubCat = Me.m_ardoc.ProblemSubCat

sendDoc.Form = “NotifyEmail”

Set RichTextItem = New NotesRichTextItem(sendDoc,“Body”)

Call RichTextItem.AppendText(“Link to your Request”)

Call RichTextItem.AddnewLine(1)

Call RichTextItem.AddnewLine(1)

Call RichTextItem.AppendDocLink (Me.m_ardoc, “Link to your Request”)

Call sendDoc.Send(True)

Hope you can provide assistance or guide me what I should be doing…

Thanks in advance!

Subject: Problems Generating email for multiple people

Edmound,

In you want to send the document to the recipients in your array, that array must be set equal to the SendTo, CopyTo or BlindCopyTo field of the document. Putting them in a field called Person won’t make a difference. It must be one of those three fields.

hth.

Brandt

Subject: Problems Generating email for multiple people

Instead of:sendDoc.Person = recipients

How about:

sendDoc.SendTo = recipients

Subject: Problems Generating email for multiple people - Fixed!

Looks like I fixed my issue…Strange I could have sworn I did that in the beginning…

Sorry for the confusion. The Person is a field on the email form which is sent out…I was putting the recipients in the Sendto section.

How I fixed the issue was the Refuser field, I thought I had it on @Unique(User1), User1 was the field which the requester would put the names of people.

I messageboxed the array so I could see if in action and it displayed every name, then sent out the email to all users!

Weird…I must have forgotten to refresh the document when I did this orginally…

Thanks for all the quick responses…I really appreciate it!

Have a great day!

Subject: Problems Generating email for multiple people

Call sendDoc.Send(True, recipients)