About This Code
Brief Description:
Send mail using rich text data
Category:
Design Elements, Lotusscript
Notes Version:
R6.x, R7.x
Last Modified:
23 Mar 2009
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
How to send advanced rich text mail? In one of my workflow application, I have to send mail with detail information. Application is use to change the group members from existing group of address book. I have created the sample template document for mail and I have added the computed text in that mail template with hard coded fields. I use hard coded fields to insert value into mail template, which will used to replace the body of mail document with mail template document.
Note - This concept will work only in inter-notes mail. Not the ouside mails.
I would appreciate your responce (+ve or -ve) on above concept.
Thank you
Ajay B Mali
Usage / Example
================================================================================================
Please follow the steps to use this concept
================================================================================================
1. Create a form MailForm. with the following fields:
Key - Text field
MailData - Rich text field
2. Save the form.
3. Create a hidden view (MailView) with view selection formula as:
SELECT ((Form = 'MailForm'))
4.Create a column (no need for column name), give the value as field Key and then sort ascending/descending order. Compose MailForm form.
5. In a rich text field from Create Menu, click on Table, select number of columns and rows and then click OK.
6. I have configure GroupName field using computed text in richtext field as shown in Image1.
7. I have configure other fields using computed text in mail format as shown in Image2 with red spot.
8. Save the document.
9. In mail part of application workflow, get the handle of document in which we saved all the rich text data.
10. Please refer the following code to use MailData document.
Set MailView=dbCurrent.GetView("MailData")
Set MailDoc=MailView.GetFirstDocument
If Not(MailDoc Is Nothing) Then
' Set MailData
Call docMail.ReplaceItemValue("LoginUser",CanonicalName.Common)
Call docMail.ReplaceItemValue("GroupName",linkDocument.GrpName_Modify(0))
Call docMail.ReplaceItemValue("RequestLink","http:\\"+linkDocument.SERVER_NAME(0)+"\"+dbCurrent.FilePath+"\0\"+linkDocument.UniversalID +"?OpenDocument")
Call docMail.ReplaceItemValue("CurrentOwner",linkDocument.OwnerList)
Call docMail.ReplaceItemValue("NewOwner",linkDocument.GrpOwners_Add)
Call docMail.ReplaceItemValue("CurrentAdmin",linkDocument.AdminList)
Call docMail.ReplaceItemValue("NewAdmin",linkDocument.GrpAdmins_Add)
Call docMail.ReplaceItemValue("CurrentMember",linkDocument.MemberList)
Call docMail.ReplaceItemValue("NewMember",linkDocument.GrpMembers_Add)
Set rtiBody2 = MailDoc.GetFirstItem("MailData")
Call rtiBody1.AppendRTItem(rtiBody2)
End If
11. Please check the Image3 for client mail which send using above concept.
12. Please check the Image4 for web mail which send using above concept.
================================================================================================
Code Attachments
Comments
Posted by John Smart on 03/31/2009 11:39:36 AMCheck out Zephyr
Ajay,
You might want to check out Chris Toohey's "Zephyr" application at http://www.dominoguru.com/pages/zephyrv0.1_tutorial.html
It's very similar to yours, except it is a standalone app that uses find/replace rather than computed text.