Solved

Logic added to a agent

Posted on 2008-10-08
1
200 Views
Last Modified: 2013-12-18
The agent working as designed.  But now I have 2 different types of emails coming in to my inbox that the agent is working on.  In the message of one of the emails there is the text jobopen and the other email has jobclosed.  Basically a email gets sent out when a job is started and when it is closed.  So the verbage has to be differnt in the email the agent is sending out.

I think the best place to put the if statement would be in the sub.  

But I am not sure how I would go about passing the value of jobopen or jobclosed to the sub?
Sub SendMemoFromTag(memo As NotesDocument, Byval tagStart As String, Byval tagEnd As String)

	

	Dim sess As New NotesSession

	Dim parts As Variant

	Dim body As String, sendto As String

	sess.ConvertMime = True

	body = memo.GetItemValue("Body")(0)

	If (Instr(1, body, tagStart, 5) = 0) Then Exit Sub

	parts = Split(body, tagStart)

	If (Instr(1, parts(1), tagEnd, 5) = 0) Then sendto = Trim(parts(1)) Else sendto = Trim(Strleft(parts(1), tagEnd))

	

	Dim memo2 As NotesDocument

	Set memo2 = memo.ParentDatabase.CreateDocument

	

	

	memo2.Form = "memo"

	memo2.Subject = "Model Shop Job Completed for " & sendto

	memo2.Body = "Your job is completed.  Please come and pick up the part."

	memo2.SendTo = sendto

	Call memo2.Send(False)

	

End Sub

Open in new window

0
Comment
Question by:Jaziar
1 Comment
 
LVL 63

Accepted Solution

by:
SysExpert earned 250 total points
ID: 22670731
IS the subject the same in both types of message ?

If not, then pass the subject as another variable to the sub, and use that to determine if it is starting or finished.


I hope this helps !
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now