Re: [WebDNA] multi [sendmail] inside [search]
This WebDNA talk-list message is from 2012
It keeps the original formatting.
numero = 109300
interpreted = N
texte = Hi Mike,I do have notices being sent each time there is an employee 'in' or ='out'.Many times they reach 40 hours in the middle of a shift, and the boss =wants to know that, so I do an hourly search of the records.The employees are on the road, and can't always reach the boss, etc.There is nobody to monitor the situation hourly, so he wants it done =automatically.I am using lookup where I can to speed things up.Thanks for the advice.sfbOn Jul 13, 2012, at 1:56 PM, Michael A. DeLorenzo wrote:> Does it make more sense if you run the search and possibly send your =email> each time someone submits a new record? I'm not sure how your database =is> setup but you could just search the total hours for a given period =each time> an employee submits there time. If the total exceeds 40 hours once the =time> is recorded you could show the user/employee a reminder and send an =email to> the boss. Your search would be fast as it would only be on that one =user> instead of the entire database. Depending on how you record the totals =you> could even do a faster lookup instead. I'm guessing the system returns =a> total to the user showing them how many hours they have accumulated? =You> could possibly use that total and show or hide the code to send the =email> and avoid a duplicate search altogether.>=20> My two cents....>=20> Mike>=20> -----Original Message-----> From: Govinda [mailto:govinda.webdnatalk@gmail.com]=20> Sent: Friday, July 13, 2012 1:38 PM> To: talk@webdna.us> Subject: Re: [WebDNA] multi [sendmail] inside [search]>=20>>=20>>>> The problem is, WebDNA doesn't like using a [sendmail] tag inside =of=20>>>> a [search...][founditems] routine.>>>=20>>> Of course it does, I've been doing this for years. What seems to be=20=>>> the problem that causes you to say this?>>=20>>=20>> The simple problem is that it won't work...>> Here's a sample....>>=20>> [search db=3D../login/website_users.db& code..blah..code...]>> [founditems] =20>> code..blah..code...>> [showif code..blah..code...>> [loop start=3D[ code..blah..code...]>=20>> [text] message =3D>> [showif code..blah..code...>> [/showif]>> [/text]>> [/loop]>> [/showif] =20>> [sendmail> to=3Dtimeclock@domain.com&from=3DWebpage@domain.com&subject=3DStaff =Over 40> message (no reply)&content-type=3Dtext/html]>> [message]>> [/sendmail]>> code..blah..code...>> [/founditems]>> [/search]>>=20>> But this does work, but with only the last item found....>>=20>> [search db=3D../login/website_users.db& code..blah..code...]>> [founditems] =20>> code..blah..code...>> [showif code..blah..code...>> [loop start=3D[ code..blah..code...]>=20>> [text] message =3D>> [showif code..blah..code...>> [/showif]>> [/text]>> [/loop]>> [/showif] =20>> code..blah..code...>> [/founditems]>> [/search]>>=20>> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@> domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]>> [message]>> [/sendmail]>=20>=20>=20> Stephen, I also have sent mail using [sendmail] countless times inside =a> [search][founditems]...>=20> But anyway, as far as the above code (latter example) only sending one> email.. well that makes perfect sense (looking at the code you wrote). = If> you want 3 emails to go out, you have to write out 3 [sendmail]'s =...or put> the [sendmail] inside a loop that will fire 3 times (like inside> [founditems] ;-) .. or inside [loop], or inside [listwords], or inside> whatever other loop serves you best. If you do not want to debug why> [sendmail] was failing inside [founditems] on your first attempt, then =you> could rewrite your latter attempt, like so:>=20> [search db=3D../login/website_users.db& code..blah..code...]> [founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[code..blah..code...]> [text]message_[index] =3D> [showif> code..blah..code...[/showif]> [/text]> =09> [text]NumTimesLoopFired=3D[index][/text][!]<--- 1.) this might go =here, or> else below---[/!]> [/loop]> [/showif] =20> code..blah..code...> [text]NumTimesLoopFired=3D[index][/text][!]<--- 2.) this =might> go here, or else above---[/!]> [/founditems]> [/search]>=20> [loop start=3D1&end=3D[NumTimesLoopFired]&advance=3D1]> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@> domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]> [interpret][message_[index]][/interpret]> [/sendmail]> [/loop]>=20>=20>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to the mailing =list>
.> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us>=20>=20>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us
Associated Messages, from the most recent to the oldest:
Hi Mike,I do have notices being sent each time there is an employee 'in' or ='out'.Many times they reach 40 hours in the middle of a shift, and the boss =wants to know that, so I do an hourly search of the records.The employees are on the road, and can't always reach the boss, etc.There is nobody to monitor the situation hourly, so he wants it done =automatically.I am using lookup where I can to speed things up.Thanks for the advice.sfbOn Jul 13, 2012, at 1:56 PM, Michael A. DeLorenzo wrote:> Does it make more sense if you run the search and possibly send your =email> each time someone submits a new record? I'm not sure how your database =is> setup but you could just search the total hours for a given period =each time> an employee submits there time. If the total exceeds 40 hours once the =time> is recorded you could show the user/employee a reminder and send an =email to> the boss. Your search would be fast as it would only be on that one =user> instead of the entire database. Depending on how you record the totals =you> could even do a faster lookup instead. I'm guessing the system returns =a> total to the user showing them how many hours they have accumulated? =You> could possibly use that total and show or hide the code to send the =email> and avoid a duplicate search altogether.>=20> My two cents....>=20> Mike>=20> -----Original Message-----> From: Govinda [mailto:govinda.webdnatalk@gmail.com]=20> Sent: Friday, July 13, 2012 1:38 PM> To: talk@webdna.us> Subject: Re: [WebDNA] multi [sendmail] inside [search]>=20>>=20>>>> The problem is, WebDNA doesn't like using a [sendmail] tag inside =of=20>>>> a [search...][founditems] routine.>>>=20>>> Of course it does, I've been doing this for years. What seems to be=20=>>> the problem that causes you to say this?>>=20>>=20>> The simple problem is that it won't work...>> Here's a sample....>>=20>> [search db=3D../login/website_users.db& code..blah..code...]>> [founditems] =20>> code..blah..code...>> [showif code..blah..code...>> [loop start=3D[ code..blah..code...]>=20>> [text] message =3D>> [showif code..blah..code...>> [/showif]>> [/text]>> [/loop]>> [/showif] =20>> [sendmail> to=3Dtimeclock@domain.com&from=3DWebpage@domain.com&subject=3DStaff =Over 40> message (no reply)&content-type=3Dtext/html]>> [message]>> [/sendmail]>> code..blah..code...>> [/founditems]>> [/search]>>=20>> But this does work, but with only the last item found....>>=20>> [search db=3D../login/website_users.db& code..blah..code...]>> [founditems] =20>> code..blah..code...>> [showif code..blah..code...>> [loop start=3D[ code..blah..code...]>=20>> [text] message =3D>> [showif code..blah..code...>> [/showif]>> [/text]>> [/loop]>> [/showif] =20>> code..blah..code...>> [/founditems]>> [/search]>>=20>> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@> domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]>> [message]>> [/sendmail]>=20>=20>=20> Stephen, I also have sent mail using [sendmail] countless times inside =a> [search][founditems]...>=20> But anyway, as far as the above code (latter example) only sending one> email.. well that makes perfect sense (looking at the code you wrote). = If> you want 3 emails to go out, you have to write out 3 [sendmail]'s =...or put> the [sendmail] inside a loop that will fire 3 times (like inside> [founditems] ;-) .. or inside [loop], or inside [listwords], or inside> whatever other loop serves you best. If you do not want to debug why> [sendmail] was failing inside [founditems] on your first attempt, then =you> could rewrite your latter attempt, like so:>=20> [search db=3D../login/website_users.db& code..blah..code...]> [founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[code..blah..code...]> [text]message_[index] =3D> [showif> code..blah..code...[/showif]> [/text]> =09> [text]NumTimesLoopFired=3D[index][/text][!]<--- 1.) this might go =here, or> else below---[/!]> [/loop]> [/showif] =20> code..blah..code...> [text]NumTimesLoopFired=3D[index][/text][!]<--- 2.) this =might> go here, or else above---[/!]> [/founditems]> [/search]>=20> [loop start=3D1&end=3D[NumTimesLoopFired]&advance=3D1]> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@> domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]> [interpret][message_[index]][/interpret]> [/sendmail]> [/loop]>=20>=20>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to the mailing =list> .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us>=20>=20>=20>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us
Stephen Braun
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
SV: WebCat on Linux (2000)
Append File help needed (2000)
File upload woes (1998)
Unix webcat perms & multiple versions of same db in cacheissue (2000)
Lookup question (2001)
Re:mac hack (1997)
HTML Editors (1997)
WebCat2 beta 11 - new prefs ... (1997)
SiteGuard Admin Feature ? (1997)
Upload Graphic Problem (2004)
WebCatalog NT beta 18 problem (1997)
WebCat2b12 - nesting [tags] (1997)
Showif date > other date (2004)
indexing dates (1998)
hmmm (2006)
Tcp connect (2002)
Test (2003)
More on the email templates (I like it) (1997)
Calculating multiple shipping... (1997)
Price characteristics? (1997)