I have written an auto reply agent in LS within a mail in database. It runs on a view and updates the document which after the agent runs puts the document into another view.
Now I have to make the body of the reply dynamic based upon what the subject of the email is. I have a view where the user enters in the subject and then what the reply will be. Do I use FTSearch, notes item?
Here is what I have already.
Dim session As New NotesSession
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim view As NotesView
Dim reply As NotesDocument
Dim col As NotesDocumentCollection
Set db = session.CurrentDatabase
Set view = db.GetView(“Reply”)
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
While Not(doc Is Nothing)
Set reply = db.CreateDocument
reply.form = “Reply”
reply.SendTo = doc.Principal(0)
reply.Subject = "RE: " & doc.Subject(0)
doc.Processed = “Yes”
Call doc.Save(False,False)
If doc.Subject(0) = "Contact Us" Then
reply.body = "Thanks" 'this is where I need it to put the dynamic body reply
End If
Call reply.Send(False)
Set doc = col.getnextdocument(doc)
Wend