Solved

Need to send an e-mail via an agent

Posted on 2003-10-21
12
188 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
  • 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now