How to send lottery by email programmatically?

I am trying to programmatically generate a lotossript (as a scripting button) from a web application (Java EE) and send it to an end user who then runs it in their Lotus Notes client.

How can I achieve this? Is there an API for me to embed lotusscript in an email?

+3


source to share


3 answers


Here's an idea. I haven't tried it and I'm not sure if this will work:

  • Create a form using the LotusScript button in Domino Designer and install it in the document
  • Create a document with this form
  • Export document as DXL (Domino XML)
  • In your Java EE application, use ncso.jar to import DXL (you can change LotusScript to XML first)
  • Email the document using Document.send()

    . When connecting to a Domino server with CORBA / IIOP, I think this should work.


Update

You might be able to skip the DXL part and just change the LotusScript in the document element. I realized that you need to change the LotusScript for each recipient. If not, then things are much easier (see Richards' answer).

+3


source


Instead of trying to insert a button, I would consider using the "saved form in document" feature of Notes.

Ie using Domino Designer I would manually create the database (I would call it “MyDb.nsf” for convenience). Create a form in this database ("MyForm" for convenience) and customize it with required fields for the email message (SendTo, Subject, Body, etc.). Then create a button on the form and enter the LotusScript code.

With this done in advance, your code can take advantage of an additional parameter attachForm

in the Document.send () method.



What you would do is open MyDb.nsf in the normal way, then use it Database.createDocument()

to create a document in that database, and then use it Document.ReplaceItemValue("Form","MyForm")

to bind that document to your form. Also set other elements (eg Subject, SendTo, Body) as needed and when done call Document.send(true)

. This will add your form to the document and submit it, so the LotusScript code will flow in the inline form that is sent with the message.

I think this might be the best way for you because I think this will keep the signature in the form when she enters it. I'm not sure about this, but on the other hand, I'm more sure that any other way of submitting using CORBA / IIOP will give you an unsigned script (since CORBA / IIOP does not have access to the private key to sign the document). And an unsigned script will mean that your users get ECL warnings when they execute them - and this could cause them to add an entry in their ECL to allow unsigned scripts, and that's bad security practice.

+3


source


Another option is to insert the url to open the page design element with code (or agent invocation) in QueryOpen, so it runs when the page is opened.

Notes://myserver.mycompany.com/utilities.nsf/MyTaskLauncher?OpenPage

      

I'm not sure if it can pass parameter values, or if you need to rely on the user's credentials to figure out the correct information.

Benefits:

  • The code is in one place, so I can update it if I find out there was a bug in the original version.
  • Minimal processing of user's mail file with saved forms.
  • Smaller email message as I don't need to submit the Information form.
  • It is easier to create a simple string in Java EE than a more powerful solution.
  • The agent can either use a Signature ID or work with Credentials.
  • Can be sent to any email address as long as the recipient has a Notes client.
+1


source







All Articles