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:
Searching,Brain Dead! (1999)
[WebDNA] External email server/service? (2016)
Webcatalog and IIS4b2 (1997)
Using Plug-In while running 1.6.1 (1997)
web delivery (1997)
select multiple 2 more cents (1997)
Country & Ship-to address & other fields ? (1997)
REPOST: Upgrage pricing... The future of WebCatalog iscoming with 4.0... (2000)
two unique banners on one page (1997)
MIMEHeaders (2004)
emailer don't work (1998)
WebCat2b15MacPlugIn - [authenticate] not [protect] (1997)
[OT] Linux Vs. OSX (leopard) server (2007)
Problems adding stuff to the shopping cart. (1997)
Encrypting the URL Query String (2003)
Requiring that certain fields be completed (1997)
listfields for a table (2007)
PCS Frames (1997)
Cart Question (1998)
different browser, different result (2000)