Solved

Need to send an e-mail via an agent

Posted on 2003-10-21
12
194 Views
Last Modified: 2013-12-18
Hi experts,
 
I've an automated scheduled agent that runs daily at 5:00 pm which will basically send an e-mail to some team members asking them to click a button in a view.

I did this by using a 'simple action' in the agent.

Now whenever they get that e-mail they have to go to the database open the designed view and click the button which will basically export the view into a text file.

Now I just to include the link of the database in the e-mail which when clicked will directly open the desired view.
Please advise
thanks
Chakrika
0
Comment
Question by:chakrika
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
12 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9594049
You can do it using script only. No Simple Actions..Sorry !

Here is a sample script from help documentation

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
Set view = db.GetView( "Boots" )
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendDocLink _
( view, view.Name & " in " & db.Title )
newDoc.Subject = "Here is a link to the Boots folder"
newDoc.SendTo = "SendTo Address"
Call newDoc.Send( False )

~Hemanth
0
 

Author Comment

by:chakrika
ID: 9594086
thanks I'll test it and let you know
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9594212
Sub Initialize

Const nameOfView = "name of some view"
Const recipientGroup = "some group to send message to - does not work with multiple names - ask if you need this"
Const Subject = "Subject of e-Mail"
Const Body = "Body text, above the link"

Dim s as new notesSession
Dim db as notesDatabase
Set db = s.currentDatabase
Dim view as notesView
Set view = db.getView(nameOfView)
If view is Nothing Then
  MsgBox "View not found - " & nameOfView
  Exit Sub
End If
Dim doc as New NotesDocument(db)
doc.Form = "Memo"
doc.SendTo = recipientGroup
doc.Subject = Subject
Dim body as New NotesRichTextItem(doc)
body.appendText Body
body.addNewLine 2
body.appendDocLink view , nameOfView
doc.Send false

End Sub
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chakrika
ID: 9595633
I've multiple e-mail addresses i've to put. I guess i've to put multiple addresses in
'recipientGroup'.
Let me know how to do this.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9595685
The easiest way?  Create a group in teh Domino directory, name it something appropriate.  Add the recipient list to the new group.  Use the group's name in the script (recipientGroup assignment).  Voila, from the script's perspective, there is onl one address, but it really does go to the full list of users.
0
 

Author Comment

by:chakrika
ID: 9598412
I know, but to create a group in my company its a big process. I do not have access to create a group and its a big process to get it. Is there any other way to include it in the code above.
0
 

Author Comment

by:chakrika
ID: 9598723
Qwaletee, I used yours and I got a compile error at Dim body As New NotesRichTextItem(doc).

Hemanth, I used yours, it works great. however, I cannot put any body in it and how can I put more than one names in the Sendto.

Your adivse is required.
thanks
Sridevi
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9598791
Declare array of names and assign it to SendTo Field..

Dim sendArr(2) as string

sendArr(0) = "Chakrika/SomeOU"
sendArr(1) = "Qwaletee/SomeOU"
sendArr(2) = "Hemanth/SomeOU"

doc.SendTo = sendArr

0
 

Author Comment

by:chakrika
ID: 9598830
Hemanth, the body has only the link. Can I put some message in the body too
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 200 total points
ID: 9598908
Here is modified code for last two requirements of yours..

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim sendArr(2) as string
sendArr(0) = "Chakrika/SomeOU"
sendArr(1) = "Qwaletee/SomeOU"
sendArr(2) = "Hemanth/SomeOU"
Set db = session.CurrentDatabase
Set view = db.GetView( "Boots" )
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendDocLink ( view, view.Name & " in " & db.Title )
Call rtitem.AddNewLine(2) ' Add lines to seperate link from text..
Call rtitem.AppendText( "Add text to the body")
newDoc.Subject = "Here is a link to the Boots folder"
newDoc.SendTo = sendArr
Call newDoc.Send( False )
0
 

Author Comment

by:chakrika
ID: 9599007
Thanks works great.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9604712
Hemanth,

I don't use OU's!  And where's the O?



:)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

739 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