Add a View Icon and Mood Stamp to an Email

The default Lotus Notes mail template includes two special fields that, when defined, will display an image either in the Inbox or in the actual email itself. Mood stamps can be used to convey a messagesuch as "Urgent," "Newsflash," or "Great Job." When displayed in the Inbox, a relatively small icon is displayed to the side of the mail subject line. When displayed in the message, the graphic displays at the top of the message. It's important to understand that implementation of this feature will depend on the mail template that has been implemented at your facility.

How It Works

Two special fields can be added to LotusScript-generated email_ViewIcon and $Moods. To utilize one or both of these items, simply set the field value prior to sending the email.

The _ViewIcon field is used to display a graphic icon next to the subject line in the user's Lotus Notes Inbox. This field must be set to a number between 1 and 77. See "Display an Icon in a View" in Chapter 15, "View Enhancements," for additional information pertaining to view icons.

The $Moods field is used to display a graphic at the top of the email itself. To display a mood stamp in the email, two fields must be set to the same value$Moods and SenderTagwhen generating the email message. Both fields must be set to the same text string character. The following are the default values.

$Moods Value

Description

Image

C

Displays the stop or confidential icon.

F

Displays a flaming or hot email.

G

Displays a gold star.

J

Displays for your eyes only icon.

M

Displays the reminder icon.

P

Displays the gold stamp

Q

Displays a question mark.

R

Displays the secret agent.

T

Displays a happy face.

Y

Displays a newsflash.

This is a Lotus Notesspecific feature designed to work with the default Lotus Notes mail template. This solution has no effect when sending email to an alternate mail client (i.e., Outlook or Yahoo). Actual implementation will depend on the mail template design implemented at your facility.

Implementation

The following code illustrates the implementation of the fields in an action button. It's important to note that both objects start with special charactersa "$" and "_". To reference these fields in LotusScript, you must prefix the field with the tilde "~" character.

Sub Click(Source As Button)

 '----------------------------------------------------------------------
 ' Define the objects
 '----------------------------------------------------------------------
 Dim s As NotesSession
 Dim db As NotesDatabase
 Dim doc As NotesDocument
 Dim Person As NotesName
 Dim rtitem As NotesRichTextItem
 Set s = New NotesSession
 Set db = s.CurrentDatabase
 Set doc = New NotesDocument(db)
 '----------------------------------------------------------------------
 ' Create the memo
 '----------------------------------------------------------------------
 Set Person = New NotesName(s.UserName)
 doc.Form = "Memo"
 doc.SendTo = Person.Abbreviated
 doc.Subject = "This is message title"
 Set rtitem = New NotesRichTextItem(doc, "Body")
 Call rtitem.AddNewLine(1)
 Call rtitem.AppendText("The body of the email message.")
 Call rtitem.AddNewLine(1)

 '----------------------------------------------------------------------
 ' Set the view icon to a value between 1 and 177)
 '----------------------------------------------------------------------
 doc.~_ViewIcon = 159

 '----------------------------------------------------------------------
 ' Set the mood stamp. Be sure to set both
 ' the $Moods and SenderTag fields.
 '----------------------------------------------------------------------
 REM "C" Displays the stop or confidential icon.
 REM "F" Displays a flaming or hot email.
 REM "G" Displays a gold star.
 REM "J" Displays for your eyes only icon.
 REM "M" Displays the reminder icon.
 REM "P" Displays the gold stamp
 REM "Q" Displays a question mark.
 REM "R" Displays the secret agent.
 REM "T" Displays a happy face.
 REM "Y" Displays a news flash.
 doc.~$Moods = "G"
 doc.SenderTag = "G"

 '----------------------------------------------------------------------
 ' Send the email
 '----------------------------------------------------------------------
 doc.Send (False)
 Msgbox "Sample email sent."

End Sub


An Introduction to the Lotus Domino Tool Suite

Getting Started with Designer

Navigating the Domino Designer Workspace

Domino Design Elements

An Introduction to Formula Language

An Introduction to LotusScript

Fundamentals of a Notes Application

Calendar Applications

Collaborative Applications

Reference Library Applications

Workflow Applications

Web Applications

Design Enhancements Using LotusScript

Design Enhancements Using Formula Language

View Enhancements

Sample Agents

Miscellaneous Enhancements and Tips for Domino Databases

Data Management

Security

Application Deployment and Maintenance

Troubleshooting

Appendix A. Online Project Files and Sample Applications

Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?



Lotus Notes Developer's Toolbox(c) Tips for Rapid and Successful Deployment
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
ISBN: 0132214482
EAN: 2147483647
Year: N/A
Pages: 293
Authors: Mark Elliott

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net