Solved

Need to send an e-mail via an agent

Posted on 2003-10-21
12
191 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating a bat file fo Note.ini 4 212
Lotus Notes 6.5.5 6 215
attaching a file lotus notes 4 110
Cannot access mail archive from IBM domino 5 103
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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