We help IT Professionals succeed at work.

In lotus script how to send a common message to several users

meetkanna
meetkanna asked
on
Medium Priority
264 Views
Last Modified: 2013-12-18
  Hi experts,

              I am a new lotus programmer.Assume I have a website called "www.kannan.com and those who visit will have to register their details including email address.Now the task that is given to me is to send a comman message(on changes made) to all those who have registered in the website using their email address.Message may be a "document" containing the changes made to the website.I don't know how to do this in lotus script.Any help would be greatly appreciated.

Thanks in advance,

cheers,

kannan
Comment
Watch Question

Commented:
OK kannan,

that is very easy in LotusScript.

Let me make some assumption and correct me if I assume something wrong.

You have a Notes form used for entering this customer data. Let us name this form: RegForm
On this RegForm you have all the fields aranged you want the user to enter. You need a second form simelar to RegForm, but arranged for email body layout. Let us call this second form: MailForm
On the RegForm is anywhere a field containing the users email address. The name of this field is not important on the RegForm, but let us name it: CustomerEmailAddress
Beside all the fields you have on this RegForm you have to set the QuerySaveAgent event for this RegForm. Therin you have to name your LotusScript agent which handles your email send action. Let us call this agent: SendMailAgent
To enter this agants name follow this steps:
1.) Open RegForm form in Designer
2.) In form design properties are bellow WindowTitle also the event WebQuerySave. Click on it
3.) Enter in the formula field of this event following formula:
@Command([ToolsRunMacro]; "SendEmailAgent")
4.) Save this form
5.) Create a new agent with following properties:
Name: SendEmailAgent
SharedAgent: checked
AgentRun? : Manualy
act on?: Run once (@Commands...and so on)
Option Public
Option Declare
Sub Initialize
 Dim session As New NotesSession
 Dim doc As NotesDocument
 Set doc = session.DocumentContext
 Msgbox "Sending email to: " & doc.CustomerEmailAddress(0)
 doc.Form = "MailForm"
 doc.Subject = "Email from agent 007"
 Call doc.Send( True, doc.CustomerEmailAddress )
End Sub

So, when you save the RegForm document, than the agent  SendEmailAgent is started. The agent sets (temporaly) the form name to MailForm and sends the RegForm document with the MailForm layout to the email address (or contained multiple email addresses). If you do not save the RegForm document, than call the agent from a button containing the same formula as the WebQuerySave event, wich was:
@Command([ToolsRunMacro]; "SendEmailAgent")

Try this all and ask for details if something is not so clear.

Good luck,
zvonko

Commented:
Hello kannan,

I have noticed that you do not ask how to proceede in the future; your question was: how to handle the former changes made.

OK, than use my upper solution for future changes.

For old changes made I do need from you some details about the field names in documents you select in a view to send to changers this CommonChangeNotification.

So, if the documents with the old changes made is selected by you from a view, and you start from there an agent, than I need at least the two field names:
ChangersEmailAddress
ChangeTextToIncludeInNotification

Place this two document item names here and I can provide you a LotusScript agent for sending this email from NotesClient. I recomad to you also to have a mailin email address for this email notifications. This mailin email address can be passed as Principal senders email address.

Waitin' for your posting,
zvonko

Author

Commented:
Hi zvonko,

          I do not understand the second mail that you have sent.What do you mean by "former changes" and "old changes".Please get back with the reason behind sending the second mail asap (as soon as possible).My personal email id is reachkandy@hotmail.com.

Thanks in advance,

kannan

Commented:
Hello kannan,

it is good practice at ExpertsExchange to make all comments to a question to a single place (for later references). I have no problems mailing you or giving you my email address, but we can clarify it here (if EE is running :-)

So now, my first posting was for cases when you like to send mail to customer immediately after they post a form (document).
My second posting is in case you do not send the mail as an immediate response to a customer posting. If you do not have this requirement, than simply forget my second posting and test the first one for solving your needs.

So again: do you responde immediately to a customer posting?

Waiting for your answer,
zvonko

Author

Commented:

   Hi zvonko,

               I am going to respond to the customer only if new changes are made to my website.It may take sometime to clarify and mail you back exactly after having talk with the client abroad.Please wait until then.Please wait.

Thanks in advance,

cheers,

kannan
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept zvonko's comment as answer.

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

CRAK
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.