[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

@mailsend sending multiple emails in scheduled agent

Posted on 2007-12-06
9
Medium Priority
?
401 Views
Last Modified: 2013-12-18
Hi,

I am trying to use @mailsend in a scheduled agent.
I am working accept for one problem...

The @mailsend is sending an email for each document. I only want it to send 1 email!

Basically I am using @elements and if the view contains more than 100 documents based on certain criteria a single email should be sent.

Currently if 48 documents match this criteria, 48 emails are sent.

How can I ensure that only 1 email is sent.

Thanks!
0
Comment
Question by:shuboarder
[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
  • 5
  • 2
  • 2
9 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20422156
You will need to switch to LotusScript to accomplish this.  Is that OK?
0
 
LVL 21

Author Comment

by:shuboarder
ID: 20422188
That's fine, but I wouldn't know how to write it in LotusScript....
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20422394
Post your agent code, and I'll see what I can do.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 21

Author Comment

by:shuboarder
ID: 20423903
Hi Bill,

very kind of you. Are you sure we can't do something clever with the formula below?

body := "this database needs attention etc."

@If(@Elements(@DbColumn("";"";"List";1))>100;
@MailSend("some.address@something.com";"";"";"Database Alert!";"";body;[PriorityHigh]);
@Return(""))


Thanks!
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 20425642
check the agent properties settings. It should run Scheduled and run on none.
0
 
LVL 21

Author Comment

by:shuboarder
ID: 20426248
Hi madheeswar,

this would make sense, but you can't have a scheduled agent with a target of "none" or can you?
0
 
LVL 21

Author Comment

by:shuboarder
ID: 20434785
I don't seem to be able to run with a target of none unless I select to run on event.
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 2000 total points
ID: 20440332
Sorry..it was my mistake.
For Scheduled agents you cannot have none.
Since it's my fault, use this code....Tested and it is working. Make it a Scheduled agent and run on all documents. Provide your email in tmpname..

Sub Initialize
	
	Dim ss As New NotesSession 
	Dim db As NotesDatabase 
	'Dim view As notesview
	'Dim dc As NotesDocumentCollection 
	'Dim doc As NotesDocument 
	Dim maildoc As NotesDocument 
	
	Set db=ss.CurrentDatabase 
	tmptotal = Evaluate(|@Elements(@DbColumn("";"";"List";1))|)
	If Isempty(tmptotal) Or tmptotal(0) < 100 Or tmptotal(0)="" Then Exit Sub
	'Send email:
	Set maildoc = New NotesDocument( db )
	maildoc.Form = "Memo"
	maildoc.Subject = "Reminder: Please Review New Application"
	Set Body=New NotesRichTextItem(maildoc,"Body")
	message="Please Review the New Application"
	Call Body.AppendText(message)
	Call Body.AddNewLine(2)
	tmpname = "Your Mail addess"
	Call maildoc.Send( True, tmpname ) 
	
	
End Sub

Open in new window

0
 
LVL 21

Author Closing Comment

by:shuboarder
ID: 31416036
Thanks Madheeswar, this seems to be working well!
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 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