Manage Learn to apply best practices and optimize your operations.

Send Pager Alert Agent

The Send Pager Alert Agent will automatically send a page via Internet pager address(s). The agent is triggered on new mail delivery. When a new message comes in that is flagged important &/or high priority, the agent create a new memo & send to the Send To(s) specified.

CAVEAT: If the person's NAB document has the Mics. setting "Encrypt incoming mail" to "Yes", this agent can not read the rich text field. (This is working as designed, according to Lotus.)

 'Send Pager Alert Agent (LS): 

Option Public
Option Declare

Sub Initialize
     Dim session As New NotesSession
     Dim dbCurrent As NotesDatabase
     Dim collUnprocessed As NotesDocumentCollection
     Dim docCurrent As NotesDocument
     Dim itemBody As NotesItem
     Dim strPriority As String, strImportance As String
     Dim varBody As Variant
     Dim strSendTo(1) As String
     strSendTo(0) = "6109999999.0505245@PAGENET.NET"   'Pager Internet Address
     strSendTo(1) = ""       'Celluar pager address
     Set dbCurrent = session.CurrentDatabase
     If (dbCurrent Is Nothing) Then
          Print "dbCurrent not set"
          Set collUnprocessed = dbCurrent.UnprocessedDocuments
          If collUnprocessed.Count < 1 Then
               Print "Nothing to process"
               Set docCurrent = collUnprocessed.GetFirstDocument
               If (docCurrent Is Nothing) Then
                    Print "Could not get handle of current document"
                         strPriority = docCurrent.DeliveryPriority(0)
                         strImportance = docCurrent.Importance(0)
                         If ((docCurrent.Form(0) = "Memo") And (strPriority = "H" Or strImportance = "1")) Then
                             'Need to create new memo & send to pager.
                              Dim docPagerMemo As New NotesDocument(dbCurrent)
                              Dim varFrom As Variant, strSubject As String, strBodyText As String
                              Stop 'use for debugging
                              docPagerMemo.SendTo = strSendTo
                              varFrom = Evaluate({@Name([CN]; From)}, docCurrent)
                              strSubject = docCurrent.Subject(0)
                              Set itemBody = docCurrent.GetFirstItem("Body")
                              If (itemBody Is Nothing) Then
                                   'Body can not be read
                                   Print "itemBody not set"
                                   docPagerMemo.Body = "Text can not be read. Check your email. | From: " & varFrom
                                   'If Body can be read, return only 200 characters
                                   'break down variables for debugging
                                   strBodyText = "From: " & varFrom(0) & " : " & strSubject & " - " & Left(itemBody.Text, 200)
                                   docPagerMemo.Body = strBodyText
                              End If
                              Call docPagerMemo.Send(False)
                              Print "Page sent"
                              Call session.UpdateProcessedDoc(docCurrent)
                         End If
                         Set docCurrent = collUnprocessed.GetNextDocument(docCurrent)
                    Loop Until (docCurrent Is Nothing)
               End If
          End If
     End If
End Sub

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...