RE: [WebDNA] multi [sendmail] inside [search]

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 109296
interpreted = N
texte = 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. My two cents.... Mike -----Original Message----- From: Govinda [mailto:govinda.webdnatalk@gmail.com] Sent: Friday, July 13, 2012 1:38 PM To: talk@webdna.us Subject: Re: [WebDNA] multi [sendmail] inside [search] > >>> The problem is, WebDNA doesn't like using a [sendmail] tag inside of >>> a [search...][founditems] routine. >> >> Of course it does, I've been doing this for years. What seems to be >> the problem that causes you to say this? > > > The simple problem is that it won't work... > Here's a sample.... > > [search db=../login/website_users.db& code..blah..code...] > [founditems]  > code..blah..code... > [showif code..blah..code... > [loop start=[ code..blah..code...] > [text] message = > [showif code..blah..code... > [/showif] > [/text] > [/loop] > [/showif] >  [sendmail to=timeclock@domain.com&from=Webpage@domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] > [message] > [/sendmail] > code..blah..code... > [/founditems] > [/search] > > But this does work, but with only the last item found.... > > [search db=../login/website_users.db& code..blah..code...] > [founditems]  > code..blah..code... > [showif code..blah..code... > [loop start=[ code..blah..code...] > [text] message = > [showif code..blah..code... > [/showif] > [/text] > [/loop] > [/showif] > code..blah..code... > [/founditems] > [/search] > > [sendmail to=timeclock@domain.com&from=Webpage@ domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] > [message] > [/sendmail] Stephen, I also have sent mail using [sendmail] countless times inside a [search][founditems]... 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: [search db=../login/website_users.db& code..blah..code...] [founditems]  code..blah..code... [showif code..blah..code... [loop start=[code..blah..code...] [text]message_[index] = [showif code..blah..code...[/showif] [/text]  [text]NumTimesLoopFired=[index][/text][!]<--- 1.) this might go here, or else below---[/!] [/loop] [/showif] code..blah..code... [text]NumTimesLoopFired=[index][/text][!]<--- 2.) this might go here, or else above---[/!] [/founditems] [/search] [loop start=1&end=[NumTimesLoopFired]&advance=1] [sendmail to=timeclock@domain.com&from=Webpage@ domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] [interpret][message_[index]][/interpret] [/sendmail] [/loop] --------------------------------------------------------- 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:

    
  1. Re: [WebDNA] multi [sendmail] inside [search] (WebDNA Solutions 2012)
  2. Re: [WebDNA] multi [sendmail] inside [search] ("Terry Wilson" 2012)
  3. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  4. Re: [WebDNA] multi [sendmail] inside [search] (William DeVaul 2012)
  5. Re: [WebDNA] multi [sendmail] inside [search] ("Terry Wilson" 2012)
  6. Re: [WebDNA] multi [sendmail] inside [search] (Govinda 2012)
  7. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  8. Re: [WebDNA] multi [sendmail] inside [search] (Terry Wilson 2012)
  9. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  10. Re: [WebDNA] multi [sendmail] inside [search] (WebDNA Solutions 2012)
  11. Re: [WebDNA] multi [sendmail] inside [search] (Stuart Tremain 2012)
  12. Re: [WebDNA] multi [sendmail] inside [search] (Stuart Tremain 2012)
  13. Re: [WebDNA] multi [sendmail] inside [search] (Govinda 2012)
  14. Re: [WebDNA] multi [sendmail] inside [search] (Terry Wilson 2012)
  15. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  16. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  17. RE: [WebDNA] multi [sendmail] inside [search] ("Michael A. DeLorenzo" 2012)
  18. Re: [WebDNA] multi [sendmail] inside [search] (Govinda 2012)
  19. Re: [WebDNA] multi [sendmail] inside [search] (WebDNA Solutions 2012)
  20. Re: [WebDNA] multi [sendmail] inside [search] (Tom Duke 2012)
  21. Re: [WebDNA] multi [sendmail] inside [search] (Stephen Braun 2012)
  22. Re: [WebDNA] multi [sendmail] inside [search] (WebDNA Solutions 2012)
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. My two cents.... Mike -----Original Message----- From: Govinda [mailto:govinda.webdnatalk@gmail.com] Sent: Friday, July 13, 2012 1:38 PM To: talk@webdna.us Subject: Re: [WebDNA] multi [sendmail] inside [search] > >>> The problem is, WebDNA doesn't like using a [sendmail] tag inside of >>> a [search...][founditems] routine. >> >> Of course it does, I've been doing this for years. What seems to be >> the problem that causes you to say this? > > > The simple problem is that it won't work... > Here's a sample.... > > [search db=../login/website_users.db& code..blah..code...] > [founditems]  > code..blah..code... > [showif code..blah..code... > [loop start=[ code..blah..code...] > [text] message = > [showif code..blah..code... > [/showif] > [/text] > [/loop] > [/showif] >  [sendmail to=timeclock@domain.com&from=Webpage@domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] > [message] > [/sendmail] > code..blah..code... > [/founditems] > [/search] > > But this does work, but with only the last item found.... > > [search db=../login/website_users.db& code..blah..code...] > [founditems]  > code..blah..code... > [showif code..blah..code... > [loop start=[ code..blah..code...] > [text] message = > [showif code..blah..code... > [/showif] > [/text] > [/loop] > [/showif] > code..blah..code... > [/founditems] > [/search] > > [sendmail to=timeclock@domain.com&from=Webpage@ domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] > [message] > [/sendmail] Stephen, I also have sent mail using [sendmail] countless times inside a [search][founditems]... 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: [search db=../login/website_users.db& code..blah..code...] [founditems]  code..blah..code... [showif code..blah..code... [loop start=[code..blah..code...] [text]message_[index] = [showif code..blah..code...[/showif] [/text]  [text]NumTimesLoopFired=[index][/text][!]<--- 1.) this might go here, or else below---[/!] [/loop] [/showif] code..blah..code... [text]NumTimesLoopFired=[index][/text][!]<--- 2.) this might go here, or else above---[/!] [/founditems] [/search] [loop start=1&end=[NumTimesLoopFired]&advance=1] [sendmail to=timeclock@domain.com&from=Webpage@ domain.com&subject=Staff Over 40 message (no reply)&content-type=text/html] [interpret][message_[index]][/interpret] [/sendmail] [/loop] --------------------------------------------------------- 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 "Michael A. DeLorenzo"

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:

OUTSIDE LINKS TO SHOW SHOPPING CART????????? (1998) bug in [SendMail] (1997) WebCatalog + WebMerchant 2.1 for Windows released (1998) using showpage and showcart commands (1996) Applescript, WebDNA, and PDF (1997) Showif, Hideif reverse logic ? (1997) Cart Question (1998) Quit revisited (1997) WCS Newbie question (1997) WebCatalog-NT?'s (1996) Country & Ship-to address & other fields ? (1997) quantity minimum problem (1997) Feedback Please (2003) [append] (1997) RE: Re:Signal Raised (1997) More on [purchase] (1998) PSC recommends what date format yr 2000??? (1997) Requiring that certain fields be completed (1997) Thanks for the cool new beta! (2000) Sandboxes (2004)