Help With Nag Mail

Posted on 2005-04-12
Last Modified: 2013-12-18
I have a Request Form on the form I have multiple Fields.  I want to add the ability to send Nag mail if there is no response to the Request by a certain date.  Right now I have a Response Form that is a response to the Request.

On the Request Form I have added a Date Field named DueDate.  I would like to also add a field named NagMail - It would ask if the requester wants a response my the due date.  If they select yes then the day it is due and everyday after the people in the SendTo Field would get a email telling them to respond.  This can be a agent that runs everynight.

Some questions I have - if there are 2 people in the SendTo and Joe responds and Jack don't only Jack should get the NagMail.  If you need more information please ask.
Question by:Jaziar
    LVL 46

    Expert Comment

    by:Sjef Bosman
    I assume both the Request and the Responses share a common unique key? Make a view containing only the Responses, sorted by that key, with a column containing the name of the respondent, and do a @dblookup for the respondents column:
        list:= @DbLookup("";"";"RespView"; key; column);

    Then you can match the respondents with the SendTo field. The mail should be sent only to the people not having responded, i.e.
        @Trim(@Replace(SendTo; list; ""))
    LVL 31

    Accepted Solution

    Have an extra field called NagList that at send time copies the recipient list ONLY IF THE NAG OPTION IS REQUESTED, and otherwise remains blank.  Change the response form so that as each response is created, it checks the nag list in the main document, and if the author is listed, removes the author from the list.

    Create a view whose selection formula is something like:
    overdue := @Today <= NagDate;
    naggies := @Trim(NagList);
    empty := naggies = "";
    SELECT overdue & !empty;

    Have your agent process all documents in that view, and send reminders to the NagList field.

    Author Comment

    Could You give me a hand on some of the code for this part

    Change the response form so that as each response is created, it checks the nag list in the main document, and if the author is listed, removes the author from the list.

    I am not sure how to check the field on the main document from the reponse document

    Author Comment

    I need to get this working as soon as possible.

    LVL 46

    Expert Comment

    by:Sjef Bosman
    I need to go as soon as possible, to have supper and then to play a volleyball-match. And then a promotion party (I hope). So I'll be back tomorrow, I hope for you that someone else will assist you in the meantime.

    Do you mind if it's LotusScript? Does it have to fit in somewhere?

    Author Comment

    Here is the reply button action.  That the user clicks to reply to the main document.

    Sub Click(Source As Button)
          Dim session As New NotesSession
          Dim ws As New NotesUIWorkspace
          Dim db As NotesDatabase
          Dim thisUIDoc As NotesUIDocument
          Dim uiDoc As NotesUIDocument
          Dim doc As NotesDocument
          Dim nDoc As NotesDocument
          Dim sDoc As NotesDocument
          Dim strServer As String
          Dim strFilename As String
          Set thisUIDoc = ws.CurrentDocument
          Set doc = thisUIDoc.Document
          strServer = doc.DatabaseServer(0)
          strFilename = doc.DatabaseName(0)
          Set db = New NotesDatabase(strServer, strFilename)
          If Not(db.IsOpen) Then
                Call db.Open("", "")
          End If
          Set sDoc = db.GetDocumentByUNID(doc.SourceDocument(0))
          Set nDoc = New NotesDocument(db)
          Call nDoc.MakeResponse(sDoc)
          nDoc.Subject = doc.Subject(0)      
          nDoc.ServerReaders = doc.ServerReaders(0)
          nDoc.BossReaders = doc.BossReaders(0)
          nDoc.DocReaders = doc.DocReaders
          nDoc.RequestSecurity = doc.RequestSecurity(0)      
          nDoc.RequestRequester = doc.RequestRequester(0)
          nDoc.RequestDate = doc.RequestDate(0)
          nDoc.Message = doc.PoopMessage(0)
          nDoc.Form = "Response Form"
          nDoc.Creator = session.CommonUserName
          nDoc.SendTo = session.UserName
          nDoc.SourceDocument = doc.SourceDocument(0)      
          Set uiDoc = ws.EditDocument(True, nDoc)
          Call thisUIDoc.Close(True)
    End Sub

    Good luck on the vollyball match

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    This is an old article, please see an updated version of this article, located here:
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 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

    10 Experts available now in Live!

    Get 1:1 Help Now