Link to home
Start Free TrialLog in
Avatar of jforget1
jforget1

asked on

Return Receipt in Script?

Have a formatted email that goes out inviting user to a hardware offer, is there a way to add a return receipt in LS to the code below. I see that it is an option in @MailSend, but cannot find it in any LS.

Joe

Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim emaildoc As NotesDocument
      Dim Item As NotesItem
      Dim twoliner As String
      Dim rtitem As NotesRichTextItem
      Dim sNamesArr(1)As String
      Dim sNamesArrB(1)As String
      Dim installDate As NotesDateTime
      Dim installTimeItem As NotesItem            
      Set db = session.CurrentDatabase
      Set col = db.UnprocessedDocuments
      Set doc = col.GetFirstDocument
      On Error Resume Next
      While Not doc Is Nothing
            If doc.invited_flag(0)<>"done" Then
                  Set emaildoc = db.CreateDocument
                  
                  emaildoc.form = "bb_invite" 'Form name of Letter
                  emaildoc.SendTo = doc.EE_Name(0)
                  emaildoc.CopyTo = "Field Technology"
                  emaildoc.BlindCopyTo = doc.bcc
                  emaildoc.Principal = "Field Technology"
                  emaildoc.Subject ="BlackBerry offer extended to " +  doc.EE_Name(0) + "!"
                  emaildoc.EE_Name = doc.EE_Name
                  Set rtitem = New NotesRichTextItem(emaildoc, "Doclink")
                  Call rtitem.AppendDocLink(doc, "")
                  Call emaildoc.Send(True)
                  doc.invited_flag = "done"    'field name for flag
                  doc.status = "Offer Sent"
                  Call doc.Save(True,True)
            End If
            Set doc = col.GetNextDocument(doc)
      Wend
End Sub
Avatar of jforget1
jforget1

ASKER

Also this button is in a view, how can I tweak this to send for the tagged(checkmark) items and not just the one that is selected with the box around the entry. It only sent the one that was selected and not the 2 that were tagged. Trying to think in the case where this is run by an action where that option comes into play.
ASKER CERTIFIED SOLUTION
Avatar of brwwiggins
brwwiggins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of SysExpert
SysExpert
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is the placement of the code proper for what I am trying to do here?

Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim emaildoc As NotesDocument
      Dim Item As NotesItem
      Dim twoliner As String
      Dim rtitem As NotesRichTextItem
      Dim sNamesArr(1)As String
      Dim sNamesArrB(1)As String
      Dim installDate As NotesDateTime
      Dim installTimeItem As NotesItem            
      Set db = session.CurrentDatabase
      Set col = db.UnprocessedDocuments
      Set doc = col.GetFirstDocument
      On Error Resume Next
      Dim col As NotesDocumentCollection ' Local only
      Set col = currentDb.unprocesseddocuments
      
      For x = 1 To col.count
            
            Set doc = col.getnthdocument(x)
      Next  ' Doc in Col
      While Not doc Is Nothing
            If doc.invited_flag(0)<>"done" Then
                  Set emaildoc = db.CreateDocument
                  
                  emaildoc.form = "bb_invite" 'Form name of Letter
                  emaildoc.SendTo = doc.EE_Name(0)
                  emaildoc.CopyTo = "Field Technology"
                  emaildoc.BlindCopyTo = doc.bcc
                  emaildoc.Principal = "Field Technology"
                  emaildoc.Subject ="BlackBerry offer extended to " +  doc.EE_Name(0) + "!"
                  emaildoc.EE_Name = doc.EE_Name
                  emaildoc.ReturnReceipt="1"
                  Set rtitem = New NotesRichTextItem(emaildoc, "Doclink")
                  Call rtitem.AppendDocLink(doc, "")
                  Call emaildoc.Send(True)
                  doc.invited_flag = "done"    'field name for flag
                  doc.status = "Offer Sent"
                  Call doc.Save(True,True)
            End If
            Set doc = col.GetNextDocument(doc)
      Wend
End Sub