Send mail with information from open form

I have a user request database in development. New request notification is via an agent which pulls info from the created request form and sends it, with a link to the request, to us.

What I’d like to do is, when the request is processed and completed, create an e-mail with certain field text from the request in the body of the message, the ‘To’ line populated by another field in the request, and display this document so additional information can be added before it is sent.

I’d also like to be able to have that message saved in the requests database.

So. I know (I think):

I need a mail enabled form similar to the mailfile ‘Memo’ form.

I’m pretty sure, with forum and Designer Help, I can puzzle my way through the code.

What I don’t know is:

How do I display the ‘memo’ form so it can be edited prior to saving and sending?

Hope I’ve made myself clear. I’ve checked both the R4/5 and the R6 forums for the past couple of days and haven’t found anything which fits.

Or is there a better way to accomplish this?

Thanks in advance for your assistance!

Subject: Send mail with information from open form

What i would is create a form called “Memo” in your database. Add the necassary fields such as SendTo, Subject, and Body. BlindCopyTo and CopyTo can be added as well. Add an action or button to the form with @Command([MailSend]).

And then you can use code such as the following to create the memo and then display it to the end user so they can edit it prior to sending.

Dim uiws As New NotesUIWorkspace

Dim s As New NotesSession

Dim db As NotesDatabase

Dim memo As NotesDocument



Set db = s.currentdatabase

Set memo = db.CreateDocument

memo.form = "Memo"

memo.SendTo = "userName"

memo.Subject = "Subject"

memo.Body = "Blah Blah blah.. yada yada yada...."



Call uiws.EditDocument( True , memo )

Subject: RE: Send mail with information from open form

Mike! Thanks for the reply. ’ Call uiws.EditDocument(… is what I was looking for. I just couldn’t figure out how to get the darn memo form to display once all the information was transferred to the doc…

I really appreciate the help.

Bruce

Subject: RE: Send mail with information from open form

I’d also create a Memo form but I’d design it for opening inside a dialogbox. At the end of the script that processes the request, I’d open the dialogbox (containing the “proposed” memo) for the user to edit. When the user clicks “OK”, the script continues, closing the dialogbox closes and sending the memo.

The advantage of using the dialogbox is that it forces the user to deal with the memo immediately. If you open the memo in a regular window, the user can ignore the memo, open another database, close Notes, etc.

Subject: RE: Send mail with information from open form

Thanks for the reply, Lawrence. Good idea, and I’ll add that functionality. It will just be us computer types who send the message, but I know if I get sidetracked, it’s like a major train derailment…

Bruce