?
Solved

Daily or weekly Email

Posted on 2009-02-16
9
Medium Priority
?
284 Views
Last Modified: 2013-12-18
I have an attendance database that I would like to send a weekly or daily email to mgmt/supervisors to tell them who is out of the office and maybe why.

The reason for the email is the traveilng mgmt and supervisor have blackberry's that have email access but not database access so they would like to know who is out and why while they are on the road.

I have an associate profile doc in the database that tells who each associates supervisor is. I have a view created that is sorted by Date and then employee Name, sup Name, type of time off, and duration. Where i am stuck is how to generate the email to send to the supervisors.

Any help would be much appreciated!!!!
0
Comment
Question by:kali958
  • 5
  • 4
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23654587
Why not hourly?? Paranoia kicking in?

Okay, here's a comparable solution:

http://www.experts-exchange.com/Q_21457437.html
0
 

Author Comment

by:kali958
ID: 23654722
Well with the way it is going, I am surpised it is not hourly :)

I get how to set the lotusscript up for the document, where i am a little lost is that i have a view set up "Sup_Email" The first column is Ascending/Categorized by Date of day off and then the next column is the Supervisor and then column 3 is the employee Name.  The part I am lost on how to do is how do I write it so that the scheduled agent will go out and find todays date, then put the supervisor name as the send to and put the empolyee name in the body.

I am not sure how to insert the data from the view. I can do a @DbLookup in formula language but I have not found how to say it in LS. Basically I want it to just go out and say, okay today is 2/16 and the supervisor is Tom Jones and Carol Smith is out, send him a email to just say that.  

I would ideally like it to be a weekly email but I am not willing to go there right now.

I have only written simple emails in LS that are based on a click. I have an example I am trying to tweak:
Sub Click(Source As Button)
	
	Dim s As NotesSession
	Dim db As NotesDatabase
	Dim ws As NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	Dim doc As NotesDocument
	Dim edoc As NotesDocument
	Dim rtitem As NotesRichTextItem
	Dim Approval As Integer
	
	Set s = New NotesSession
	Set db = s.CurrentDatabase
	Set ws = New NotesUIWorkspace
	
	Set uidoc = ws.CurrentDocument
	Set edoc = New NotesDocument(db)
	Set rtitem = New NotesRichTextItem(edoc, "Body")
	Set doc = uidoc.Document
	'Set uidoc = ws.EditDocument( True )
	uidoc.EditMode = True
 
***I AM ASSUMING HERE IS HERE I WOULD PUT THE GETDOCUMENTBYKEY but I am lost on how to use this
 
	edoc.SendTo = doc.Supervisor(0)
	edoc.Subject = "Associates Out of Office"
	Call rtitem.AppendText("Here is a list of Associate Out of office.")
	Call rtitem.AddNewline(2)
	Call rtitem.AppendText(" ")
	Call rtitem.AddNewline(2)
	Call rtitem.AppendText(" ")
	Call edoc.Send(False)
	
 
	
End Sub

Open in new window

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 23655182
I suppose the view is not ideal for your agent. Far more suitable seems a view ordered by supervisor, then date off, then employee, or the latter two reversed. That way, you can prepare a mail per supervisor.

Walking through the mail should be easy. Have a look in the Designer Help database, in the examples of the NotesViewNavigator and NotesViewEntry methods. They are exactly what you need.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:kali958
ID: 23655489
Okay - I will change the view to be the Supervisor in the first column, Ascending and Catorgized, and then put the date column second and the employeename third.

I will research the NotesViewNavigator and NotesViewEntry method - Thank you. Do I also need to continue w/ researching the GetDocumentByKey?  That is where I seem to be a little lost.

Just to make sure I understand, by changing the view I can have the code then go look at the supervisor name, and if the "Today's" date is in the 2nd column it can then email the supervisor with the employee's name?  I am a bit concerned that this will send an email for each individual associate (so if the sup had two people out, they would get two emails) but then again they asked for a email notification.

I will see how tomorrow goes and let you know.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23657039
General idea:

 open the view
 do until eof(view)
      read one line
      if this line contains a new supervisor then
            send assembled mail
            clear mail
      fi
      if there's no mail-document yet then
            create mail-document
      fi
      put info in mail-document
od
if the current mail-document is not sent
      send assembled mail
fi
0
 

Author Comment

by:kali958
ID: 23659782
The view right now contains all the time off requests in the database, would it be better if I run the agent daily to then set a status on the form to say "Notification Sent" or it is more coding to have it look at today's date and then send the email?  I was thinking that the key would be the date but I can also change the view to only display today's people that are out of the office and then send the email?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23665516
Normally, my scheduled agents always run hourly. If not all code should be executed hourly, I make my own scheduler and logging in a profile document. For instance, I need some code to run nightly, but only once; I put some code in the agent like
      If the daily routine didn't run today Then
            Call daily_routine
            Call update profile document
      End If

A similar thing could be done for your weekly stuff.

The code I add is to make sure the routine isn't executed twice on the same day, e.g. example when an administrator decides to resign all agents or so. I dislike updating documents for no good reason, but if it helps by all means add it. If you need an indicator, you can always use a hidden folder to put your documents in. And if a field should be set in all documents in that folder, you can use StampAll()
0
 

Author Comment

by:kali958
ID: 23682119
sjef - I am still working on this issue but a urgent update has come thru that I have to process before i can get back to this issue. Thanks for pointing me in the right direction thou. I will close this question for now and if I need further help I will get something out here.
Thanks for all your help!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 23682240
You're welcome!!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 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