Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1358
  • Last Modified:

Appending signatures to email when sent via Lotus Notes api

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
jennyd
Asked:
jennyd
  • 4
  • 3
  • 2
  • +2
1 Solution
 
madheeswarCommented:
did u add signature in Preferences in Lotus Notes
0
 
madheeswarCommented:
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
 
Bozzie4Commented:
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
pgloorCommented:
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
 
pgloorCommented:
Sorry, typo: "CalendarProfile" not "CalendarProfiles".
0
 
jennydAuthor Commented:
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
 
Stan ReeserTechnology StrategistCommented:
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
 
Bozzie4Commented:
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
 
Stan ReeserTechnology StrategistCommented:
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
 
Bozzie4Commented:
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
 
Bozzie4Commented:
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
 
Stan ReeserTechnology StrategistCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

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.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now