Mimic multiple signature support with stationaries
Ferdi Verlaan March 2 2010 12:13:57
Normally we would advise against changing the default mail template. It demands additional focus and testing when upgrading the Domino server. In this case we went against our own advice, and made changes to a mail template so that multiple people can work within it. A team-box if you like.Now there is an excellent teambox template available on openntf.org. But the design of that template is very oldschool, and the client wanted the new and improvement look of Lotus Notes 8.5. Altough we would like to contribute add upgrade the design of the openntf template, unfortunatly the time is not on our side at the moment. Therefor the client and AASHQ have decided to update the current 8.5.1 mailtemplate.
Multiple signatures
The client wanted to work with multiple people in the team-mailboxes, but would like to keep their own identity in the signatures. The client is custom to using stationaries and work from there, but when replying and forwarding a message this option couldn't be used. We have created an additional view in template called '(StationaryLU)'. This is a copy of the standard view '(Stationary)'. We only removed the first three columns, as you can see in the image. We did this for a more simple lookup in the following code, you can also adjust the lookup-code to mimic the first three columns.
The users are creating their stationaries (signatures) and save them with a name in the format 'Handtekening<space>Full Name'. The word 'Handtekening' is Dutch for 'Signature'. We made the 'lookup-name' as user-friendly as possible as you can see.
Then we altered the sub 'InsertSignature' in the script library 'CoreEmailClasses', to the code below:
Const msgTxt = "This file contains one or more contacts. In Notes double-click the " &_
"attachment to add to your Contacts. In other mail systems you may have to save the "&_
"file to your desktop and then import it into your Contacts."
Dim s As New NotesSession
Dim db As NotesDatabase
Dim profileDoc As NotesDocument
Dim wksp As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Dim nam As Notesname
Dim view as NotesView
Dim stationarydoc as NotesDocument
Set db = s.CurrentDatabase
Set profileDoc = db.GetProfileDocument("CalendarProfile")
Set view = db.GetView("(StationeryLU)")
Set uiDoc = wksp.CurrentDocument
Set nam = New NotesName(s.UserName)
Set stationarydoc = view.GetDocumentByKey("Handtekening " & nam.Common,True)
If Not stationarydoc Is Nothing Then
Call uidoc.ImportItem(stationarydoc,"Body")
Else
If profileDoc.HasItem("Signature_Rich") Then
If uidoc.Document.HasItem("$VAttach") Then
Call uidoc.FieldSetText("body", msgTxt + Chr(10) + Chr(10))
End If
Call uiDoc.ImportItem(profileDoc, "Signature_Rich")
End If
End If
You can find the code within a script variable, which will be 'Executed' later on in the code.
The code is a minimal adjustment to the original, and we only check the stationaryLU view for an entry with the name based upon the username. If this document is found we use the NotesUIDocument.ImportItem method to succesfully imported the Richtext Item. You can also update the (InsertSignature) agent with the above code.
As you can see, if no stationary document has been found, the default signature is used (when available). A simple adjustment with great impact for our client's users.
- Comments [1]