Solved

Need to send an e-mail via an agent

Posted on 2003-10-21
12
192 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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