Problem Adding Disclaimer to Mail.box Design

Upper management has decided that they want disclaimer messages on ALL messages, even those between users within the company – not just outbound smtp. On our mailserver (not the outbound smtp server) I have attempted to:

First, add disclaimer text under the Body field in the Memo form of mail.box and having failed that…

Second, add a calculated when composed field under the body field in Memo form.

In both situations, the disclaimer never shows up in the message. I have checked the hide-when properties and their are no propertied enabled that would hide the text or the field. What do I need to do differently?

Thanks,

John Rowland

Murphy Oil Corporation

Subject: Problem Adding Disclaimer to Mail.box Design

See below, we have a central repository for keywords throught applications. We have two fields, the disclaimer and a tagline type thing, where we can put in things like ‘check out our website at…’, or voted #1 in…etc.

Just an FYI before I get to the code, I think I saw somewhere that a future release would have this built in. I don’t know if it is 6.5.4 or if they meant 7.0.

Below is the code that I put in on the postopen event:

Dim session As New NotesSession

Dim location As String

Dim localview As NotesView, view As NotesView

Dim localdoc As NotesDocument

Dim localdb As NotesDatabase, keyworddb As NotesDatabase, currentdb As NotesDatabase



Dim strServer As String, strFile As String

If source.IsNewDoc Then

	If Left(source.FieldGetText("Subject"),2) = "Re" Then

		Exit Sub

	End If

	If Left(source.FieldGetText("Subject"),2) = "Fw" Then

		Exit Sub

	End If

	curloc=session.getenvironmentstring("Location", True)

	For a=1 To Len(curloc)

		tmpstring=Left(curloc,a)

		If Right(tmpstring,1)="," Then useloc=Left(curloc,a-1)

		If Right(tmpstring,1)="," Then 

			Exit For

		End If

	Next

	

	Set localdb = New NotesDatabase( "", "names.nsf" )

	Set localview = localdb.GetView("Locations")

	Set localdoc = localview.GetDocumentByKey(useloc)

	Set keyworddb = New NotesDatabase( localdoc.mailserver(0), "keywords.nsf" )

	

'Check to make sure we can connect to the keyword list

	If keyworddb.IsOpen Then

		Set view = keyworddb.GetView("AdminKeys")		

		Set doc = view.GetDocumentByKey("Email Tag Line")

		Call source.FieldAppendText("Body",Chr(10))

		Call source.FieldAppendText("Body",doc.AdminKeywords(0))

		Call source.FieldSetText("TagLine",doc.AdminKeywords(0))

		Set doc = view.GetDocumentByKey("Legal Statement")

		Call source.FieldAppendText("Body",Chr(10))

		Call source.FieldAppendText("Body",Chr(10))

		Call source.FieldAppendText("Body",doc.AdminKeywords(0))

		Call source.FieldSetText("LegalStatement",doc.AdminKeywords(0))	

	Else

		Set currentdb = session.CurrentDatabase

		Set view = currentdb.GetView("($Sent)")

		Set doc = view.GetLastDocument

		If doc Is Nothing Then

		Else

			Call source.FieldAppendText("Body",Chr(10))

			Call source.FieldAppendText("Body",doc.TagLine(0))

			Call source.FieldAppendText("Body",Chr(10))

			Call source.FieldAppendText("Body",Chr(10))

			Call source.FieldAppendText("Body",doc.LegalStatement(0))

		End If

	End If	

End If

Subject: RE: Problem Adding Disclaimer to Mail.box Design

Greg,

Thanks for the response. Just wanted to make sure where you are putting the code. It goes in the postopen event of the Memo form in mail.box – right? If you know, will this work on outbound smtp only or on notes mail between mail servers within the corporation, too?

John Rowland

Murphy Oil Corporation

Subject: RE: Problem Adding Disclaimer to Mail.box Design

Hi Greg,

The feature has been planned for R7. Doubt they will include it in R6.

//Kjeld

Subject: RE: Problem Adding Disclaimer to Mail.box Design

Figured it would be R7. But one can only help.

And to answer the previous post, no, I don’t put this on the mail.box. I put it on all emails when they open it. Rather not get messy in the mail.box.

Subject: RE: Problem Adding Disclaimer to Mail.box Design

Greg,

I assume, then, that you modify the mail client template. When the user opens mail, does the disclaimer become an actual part of the message, i.e. is it appended to the body in some way? If no, is it, more or less, a display only – computed for display? How do you handle that and where do you put the code in the template? I am needing a speedy resolution to this issue. We have support with Lotus, and I have been urged to go to their support with this issue, but I am not sure they can be any more helpful than this forum, given the techdocs that I have read. That will be my next step.

Thanks a bunch,

John

Subject: RE: Problem Adding Disclaimer to Mail.box Design

Yes, unfortunately I do. That is why I said that in Notes/Domino 7, there will be a new option.

Yes it becomes part of the message, so it can be deleted. It cannot be computed for display, or anything like that, it has to be in the ‘body’ of the memo. I put it on the postopen event. Where I grab our disclaimer, and our marketing statement.

I don’t think Lotus support is the right answer for this, because technically, nothing is wrong with the notes client. Is it a needed tool? Seems to be for most company nowadays since it will be in the next version. So basically I think Lotus Support would say that you would have to wait until then. I for one am looking forward to the code for this.

Subject: Resolution

Thanks for your helpful input. In the client template, I ended up adding a HasDisclaimer field to the Memo, Reply and Reply With History forms. Then I added code to the QuerySend event which 1) checks to see if HasDisclaimer is true, 2) appends the disclaimer to the body field if not already disclaimered and 3) resets the HasDisclaimer field to true. This method works for all messages, within the Notes network and out to the internet via smtp.

I did some other things which make it work for messages sent from Blackberries – which don’t use the Notes client for message sends.

I appreciate your help.

John Rowland

Subject: Post Code

Could you post you code here? I have been trying to something similar to this for some time but I was not able to do that.

Thanks a lot.

Subject: RE: Post Code

I revisited this post long after the request for posted code. If anyone is interested, email me: john_rowland at murphyoilcorp dot com