Blogroll

Misc

Subscribe
Add to Technorati Favorites


Blogarama - The Blog Directory

Send email notification with LotusScript

September 16th, 2009 by bfebrian

Lotus Notes and Domino is not only  about email, it’s more than that. One of it’s feature it workflow, where people can create workflow application faster an d easier than any other application out there.

One of the important thing in workflow is email notification, to let users know that they have one job to do, or just simply notification.

Example,  if a staff create a leave request and when he or she submit the request, his or her manager will get an email notification about the request.

I have this one of my favorite sub program to create an email notification, well I named it “CreateEmailNotification” :) .

If you like, you can use it for free. Just copy the sub program in one or new Script Library.

This is the sub program.

=====Start of Sub Program
Sub CreateMailNotification(doc As notesdocument, strSendTo As Variant, strSubject As String, strCopyTo As Variant)

Dim session As notessession
Dim db As notesdatabase
Dim docMail As notesdocument
Dim rtitem As Variant

Set db = doc.parentdatabase
Set session = db.Parent
Set docMail=db.createdocument
Set rtitem=docMail.CreateRichTextItem(“Body”)

If strSendTo(0)=”" Then Exit Sub

‘=====set mail
docMail.Form = “Memo”
docMail.From = session.UserName
docMail.Principle = session.UserName
docMail.SendTo = strSendTo

If Isarray(strCopyTo) Then
If strCopyTo(0)<>”" Then
docMail.CopyTo = strCopyTo
End If
Else
If strCopyTo<>”" Then
docMail.CopyTo = strCopyTo
End If
End If

docMail.Recipients = strSendTo
docMail.Subject = strSubject
docMail.PostedDate = Now

‘=====set body field
Call rtitem.AppendText(“Please click this doclink to see more details about the status ” + ” “)
Call rtitem.AppendDocLink( doc, “click to open document”)
Call rtitem.AddNewLine( 2 )

‘=====send mail
Call docMail.send(False)
End Sub
=====End of Sub Program

Feel free to do some modification if necessary.

You can call it from any lotusscript with simple line like this.

call Call CreateMailNotification (doc, doc.nmSendTo, strSubject,doc.nmCopyTo)

Don’t forget to put use “Script Libary Name” first.

Bookmark and Share

Popularity: 5% [?]

Tags: , , , ,

Save to del.icio.us | Stumble It! | Submit to Netscape | Digg This!

Related Posts:

  • Sample of Email Policy for office use
  • Problem With Pop3 in Domino 8
  • TeamViewer, king of remote access
  • Most common Outlook Express problems
  • Annoying Email Signatures
  • Posted in Lotus Notes and Domino, Programming | 1 Comment »

    One Response

    1. kberg Says:

      We use the Ionet Workflow Manager for developing our Workflow applications. With this engine workflows can be created very easy, no programmeing experience needed.

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.