?
Solved

Logic added to a agent

Posted on 2008-10-08
1
Medium Priority
?
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 63

Accepted Solution

by:
SysExpert earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

801 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