Want to give the ability for some of our blackberry users to send an Email to a certain address and have it trigger an agent that will then reply to them with certain information. Mail-in database will cover that from what I have read.
Unfortunately I cannot find a huge amount of information about mail-in databases so figured I would ask.
If I have a few databases that I would like the above scenario to cover, what would be the best way to do this? Should I make just one mail-in database or make a mail-in database for each database?
I am thinking make one mail-in database and when mail arrives it triggers an agent. And then have that agent process the Email and as long as it passes certain criteria have it then call another agent to process the appropriate database and and respond to the request with the information.
Can an Email sent to this MID with a specific subject line be enough information to do what I want? Am I way off base here?
Subject: Best/recommended use for mail-in database
This is a perfect application of the mail-in database functionality. Many applications and domino system databases work this way. The mail router creates the message in the database, and you can use an ‘after new mail’ triggered agent to process it (or a scheduled agent).
As to one versus many databases, it depends on the details. For me, I wouldn’t want to depend on the text in a subject line unless it was being created programatically. If users have to type in the subject you will have a problem.
Subject: RE: Best/recommended use for mail-in database
Well its only for a handful of users and the desire is for them to be able to poll for different information depending on the situation. So no matter what I believe I am going to have to rely on these few to type the subject line correctly. I will make the triggers a simple word hopefully.
Thanks for your help, is there anything I really need to be aware of for MID? It seems straight forward in theory, but Lotus Notes does not always fall under the straight forward concept.
Subject: RE: Best/recommended use for mail-in database
I use an automated password systems- that has the following code in the “When new e-mail arrives” - the customer has to send us an e-mail from the account they registered with us- when their e-mail comes in, the agent checks to see if it a registered e-mail address and then grabs the appropriate information and e-mails them back. MID is used to suck out the e-mail address alone.
Dim s As New NotesSession
Dim db As NotesDatabase
Dim LookUpView As NotesView
Dim ConfirmView As NotesView
Dim ConfirmVC As NotesViewEntryCollection
Dim ConfirmDoc As NotesDocument
Dim lookupdoc As NotesDocument
Dim EmailDoc As NotesDocument
Dim StartP As Long
Dim EndP As Long
Dim LengthE As Integer
Set db = s.CurrentDatabase
Set LookUpView = db.GetView("RegistrationByEmail")
Set ConfirmView = db.GetView("EmailRegistration")
Set ConfirmDoc = ConfirmView.GetFirstDocument
Do Until ConfirmDoc Is Nothing
Dim Lookupemail As String
'this strips the e-mail address out of the incoming e-mail
lookupemail = confirmdoc.From(0)
Endp = Instr(Lookupemail, ">")
StartP = Instr(Lookupemail, "<")
LengthE =EndP-(StartP+1)
If EndP > 0 Then
LookUpEmail = Mid(LookUpEmail,(StartP+1),LengthE)
End If
Set LookupDoc = LookupView.GetDocumentByKey(LookUpEmail)
If Not LookupDoc Is Nothing Then
If lookupDoc.PasswordSent(0) <> "Yes" Then
Msgbox "emailing " & lookupDoc.entityname(0)
Set EmailDoc = db.CreateDocument
EmailDoc.sendto =LookUpdoc.Email(0)
EmailDoc.CopyTo=AdminAlerts
EmailDoc.form="Memo"
EmailDoc.Principal = "My Company Systems Registrar"
EmailDoc.Subject = "Email Confirmation for " & LookupDoc.EntityName(0)
Body1 = "Dear " & LookupDoc.FirstName(0) & " " & LookupDoc.Lastname(0) & ":"
Body2 = " We welcome your....."
Body3 = " The ... " & LookupDoc.EntityNumber(0) & "."
Body4 = " Your password is case sensitive. It is: " & LookupDoc.InitPassword(0)
Body5 = " Once your password is reset, you will be required to change it every 90 days. If you get locked out of the system, please call ....."
Body6 = " Your ... Representative is: " & LookupDoc.rep4(0)
Body7 = " Your Distributor is: " & LookupDoc.Distributor(0)
Body8 = " Your Independent Representative is: " & LookupDoc.IndependentRep(0)
Body9 = " Password help can be found at http://www......com/Help/PasswordHelp.html"
Body10 = " Your ....Systems Team"
’ Print Tab(5) “Creating and sending mail to the following recipients:” &ThisDoc.AssignedTo(0) & " & " & ThisDoc.SupervisorCalc(0) & " & " & ThisDoc.ReqName(0)
Set richbody = New Notesrichtextitem(EmailDoc,"body")
Call richbody.AppendText(body1)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body2)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body3)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body4)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body5)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body6)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body7)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body8)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body9)
Call RichBody.addNewLine(2)
Call RichBody.AppendText(Body10)
Call RichBody.addNewLine(2)
LookupDoc.PWSentDate = Cstr(Now)
LookupDoc.PasswordSent = "Yes"
LookupDoc.Status ="Email Sent"
Call Lookupdoc.Save(True,True)
Call EmailDoc.Send(False)
Call EmailDoc.Save(False,False)
End If
End If
Set ConfirmDoc = ConfirmView.GetNextDocument(ConfirmDoc)
Loop