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 emaileach time someone submits a new record? I'm not sure how your database issetup but you could just search the total hours for a given period each timean employee submits there time. If the total exceeds 40 hours once the timeis recorded you could show the user/employee a reminder and send an email tothe boss. Your search would be fast as it would only be on that one userinstead of the entire database. Depending on how you record the totals youcould even do a faster lookup instead. I'm guessing the system returns atotal to the user showing them how many hours they have accumulated? Youcould possibly use that total and show or hide the code to send the emailand 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 PMTo: talk@webdna.usSubject: 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] > [sendmailto=timeclock@domain.com&from=Webpage@domain.com&subject=Staff Over 40message (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 oneemail.. well that makes perfect sense (looking at the code you wrote). Ifyou want 3 emails to go out, you have to write out 3 [sendmail]'s ...or putthe [sendmail] inside a loop that will fire 3 times (like inside[founditems] ;-) .. or inside [loop], or inside [listwords], or insidewhatever other loop serves you best. If you do not want to debug why[sendmail] was failing inside [founditems] on your first attempt, then youcould 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] =[showifcode..blah..code...[/showif][/text][text]NumTimesLoopFired=[index][/text][!]<--- 1.) this might go here, orelse below---[/!][/loop][/showif] code..blah..code...[text]NumTimesLoopFired=[index][/text][!]<--- 2.) this mightgo 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.usBug Reporting: support@webdna.us
Associated Messages, from the most recent to the oldest:
Does it make more sense if you run the search and possibly send your emaileach time someone submits a new record? I'm not sure how your database issetup but you could just search the total hours for a given period each timean employee submits there time. If the total exceeds 40 hours once the timeis recorded you could show the user/employee a reminder and send an email tothe boss. Your search would be fast as it would only be on that one userinstead of the entire database. Depending on how you record the totals youcould even do a faster lookup instead. I'm guessing the system returns atotal to the user showing them how many hours they have accumulated? Youcould possibly use that total and show or hide the code to send the emailand 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 PMTo: talk@webdna.usSubject: 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] > [sendmailto=timeclock@domain.com&from=Webpage@domain.com&subject=Staff Over 40message (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 oneemail.. well that makes perfect sense (looking at the code you wrote). Ifyou want 3 emails to go out, you have to write out 3 [sendmail]'s ...or putthe [sendmail] inside a loop that will fire 3 times (like inside[founditems] ;-) .. or inside [loop], or inside [listwords], or insidewhatever other loop serves you best. If you do not want to debug why[sendmail] was failing inside [founditems] on your first attempt, then youcould 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] =[showifcode..blah..code...[/showif][/text][text]NumTimesLoopFired=[index][/text][!]<--- 1.) this might go here, orelse below---[/!][/loop][/showif] code..blah..code...[text]NumTimesLoopFired=[index][/text][!]<--- 2.) this mightgo 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.usBug 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:
[WebDNA] How WebDNA email sending works... (2012)
RE:It just Does't add up!!! (1997)
database size? (1997)
WebCat2 - [format thousands] (1997)
PIXO Support (1997)
decrypt trouble - solved (2006)
Search returns all, not 20 (1997)
Emailer Error 550 (Was Strange Crash) (1998)
Webcat/Webmerchant part II (1998)
new cart IDs being assigned somehow (1997)
(1997)
webcat 3.06f on Linux keeps dying (1999)
my price won't move (1997)
WebMerchant & CC Response (2002)
upgrading (1997)
pictures / referrer etc. (1998)
Showif, Hideif reverse logic ? (1997)
[sendmail] questions... (1997)
[WebDNA] WebDNA and MAMP/Apache (Mac) (2018)
[WebDNA] Limited Time Discount on WebDNA Server licenses (2013)