Solved

Appending signatures to email when sent via Lotus Notes api

Posted on 2004-04-04
13
1,266 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
Comment Utility
did u add signature in Preferences in Lotus Notes
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
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
Comment Utility
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
 
LVL 5

Expert Comment

by:pgloor
Comment Utility
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
Comment Utility
Sorry, typo: "CalendarProfile" not "CalendarProfiles".
0
 

Author Comment

by:jennyd
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 4

Expert Comment

by:sreeser
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now