Solved

Appending signatures to email when sent via Lotus Notes api

Posted on 2004-04-04
13
1,285 Views
Last Modified: 2013-12-18
We have a powerbuilder application that has its own mail window allowing users to compose an email.  The email is then sent through lotus notes through a notes api.  Unfortunately we are unable to get each users signature to be included on the bottom of the email.

We also have the same problem with outlook

We think it is due to having our own compose window.

Any suggestions on how to get around these issues?
0
Comment
Question by:jennyd
  • 4
  • 3
  • 2
  • +2
13 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 10755789
did u add signature in Preferences in Lotus Notes
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10755814
U need to add Signature in Lotus Notes to allow notes to add signature.

How ur generating notes memo? I think Notes will be opened when ever ur creating a new memo through API.

Add the signature in the users mail database (open mail db-> Tools->Preferences->Signature button and enable Auto insert...)

I did not tried the above , just an idea.

Is there any thing ur appending message to the body of email through API? If so, then why can't u capture the user name and append the name and etc., through code?

Else, create a field in memo form in the mail template and there u add @Name([CN];@userName). Make the field computed and may I know the structure of the sugnature u r looking?

Hope it helps.

0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10755854
You will have to get the Signature from the preferences Profile document for the user who is sending it.

That would involve some extra coding :

(I assume  maildb to be set to the current user's mailfile)

dim theSignature as string
dim calprofile as notesdocument
Set calprofile = maildb.GetProfileDocument("CalendarProfile")
      
TheSignature = calprofile.Signature(0)

...
(in the memo, append this to the Body field (BodyItem needs to be a notesrichtextitem))

Call bodyItem.appendtext( theSignature )

cheers,

Tom
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:pgloor
ID: 10755953
I don't know about Outlook. In Notes, depending on users options, signatures are either stored in the "CalendarProfile" in the mail database or in a text file. Your API needs to check the "CalendarProfiles" signature options and perform the appropriate action. The "CalendarProfile" contains the following fields related to signatures.

Fields Signature, Signature_1 and Signature_2 (see below).

EnableSignature = "" or not available :Dont append signature.
EnableSignature = "1" : Append signature.

SignatureOption = "1" : Signature is stored as text in fields Signature and Signature_1
SignatureOption = "2" : Signature is stored in a text file. Fields Signature and Signature_2 contain the path to the text file.

Peter



0
 
LVL 5

Expert Comment

by:pgloor
ID: 10756040
Sorry, typo: "CalendarProfile" not "CalendarProfiles".
0
 

Author Comment

by:jennyd
ID: 10761660
Yes a signature has been added in the profile.

Is there anyway to do this without changing the application code as it is already rolled out at customer sites.  Is there a setting in the Notes.ini or something?
0
 
LVL 4

Expert Comment

by:sreeser
ID: 10761885
Add this sub to the script library emailProcessing in the template and update all the templates (after you test it)... then as the message is created this will execute (unless you bypassed the script libraries - not someting I would reccomend and I highly doubt that you did).  You may have to change the second line to whatever the singnature field is in your file and also note.form(0) = memo if you called it something else. )  this was designed for 4x.  It is nice because it handles 1400 characters of text and puts it in the UIDOC.

Sub SignatureAdd
      Dim notesSession As New NotesSession
      sigText = note.Signature(0)
      subString1$ = Left$(sigText, 200)
      subString2$ = Mid$(sigText, 201, 200)
      subString3$ = Mid$(sigText, 401, 200)
      subString4$ = Mid$(sigText, 601, 200)
      subString5$ = Mid$(sigText, 801, 200)
      subString6$ = Mid$(sigText, 1001, 200)
      subString7$ = Mid$(sigText, 1201, 200)
      
      Call uidoc.GotoField( "Body" )
      If Len(subString1$) >0 Then Call uidoc.InsertText( subString1$)
      If Len(subString2$) >0 Then Call uidoc.InsertText( subString2$)
      If Len(subString3$) >0 Then Call uidoc.InsertText( subString3$)
      If Len(subString4$) >0 Then Call uidoc.InsertText( subString4$)
      If Len(subString5$) >0 Then Call uidoc.InsertText( subString5$)
      If Len(subString6$) >0 Then Call uidoc.InsertText( subString6$)
      If Len(subString7$) >0 Then Call uidoc.InsertText( subString7$)
      If note.Form(0) = "Memo" Then
            Call uidoc.GotoField( "SendTo" )
      Else
            Call uidoc.GotoField( "Body" )
      End If
End Sub
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10763341
You could add the signature to the notes.ini, but then a user would have 2 places to hold his signatures, and you would probably change the design of the mailtemplate (something I wouldn't do unless there is a very great need).

You should be able to add the snippets of code (mine, peter's) to your existing script, it's only 5-10 lines extra code...  

Other approaches would be to add code to the mail.box (change the design of the Memo form ) (not recommended), or to (try) to work with a server-based mailrule to automatically append it.  I don't think these approaches are good alternatives, so I would still advise you to change your application.....

Tom
0
 
LVL 4

Expert Comment

by:sreeser
ID: 10763632
Tom, be careful, in your solution the signature is set to a string and  has to be less than appx 250 characters (youd think it would be 256 but I think it is 253.  Thats why  I had to break it in to chunks (odd thing when my client was using during the migration to 6 it put some carrige returns when executed from a 6 client but not from the 46x still never figured that out.).
You could also do copyitem in the back end , but there is already something in the body.
0
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 500 total points
ID: 10763726
That 's not correct.  The limit for the appendtext method , and for the field Signature is appr. 32 Kb.  (some sources say 20 Kb, but whatever, the limit is not 256/253 characters)

My code will work, even for carriage returns ...  On 4.6, the situation may be different (not regarding the limit - I'm sure that the appendtext limit has always been this high).  You are mixing 2 things : the uidoc.inserttext may well have a limit of 256 characters, but you probably can't use these frontend classes/methods anyway, so why bother ?  

About the carriage returns : they could pose problems (for instance when the signature field would be a multi-value text field, and hence be an array).  You can solve that quite easily, but looping through the array, appendtext-ing the value, adding a newline (addnewline), and continuing ...

cheers,

Tom



0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10763735
And if your application has a limit of 256 characters for String, you shouldn't use a String to hold the intermediate value ....

cheers,

Tom
0
 
LVL 4

Expert Comment

by:sreeser
ID: 10764078
You are correct sir... it is the uidoc.inserttext that has the limit.  It is 3 AM :) I should go to bed

The reason I set it up in the ui is for the forward/reply... if you forward or reply with history and then append the message on send it puts it all the way at the bottom... not what my client wanted.   But Tom is right if you cant use the front end then what does it matter (and the users probably can't forward/reply anyway)

My comment about the CR was that when we migrated the "sigText" had these leading CRs that didnt appear when executed from 4x  Just something I ran across, didnt mean to say yours couldn't handle them.

g'nite <:^)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question