<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 3, 2010, at 20:29 PM, Lyn St George wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Wednesday 03 February 2010 18:49:34 Rick Bragg wrote:<br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is there a way to use the email tag so that IC does not have to wait<br></blockquote><blockquote type="cite">after sending out all mail before returning a page?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">In other words, I am using the email tag to send out emails to a group<br></blockquote><blockquote type="cite">of users whenever a single user creates a new piece of content on a<br></blockquote><blockquote type="cite">site.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I have set up a system where once a user creates some new content, and<br></blockquote><blockquote type="cite">hits a "publish" button, a form gets passed to a "publish" routine that<br></blockquote><blockquote type="cite">includes a loop using the "email" tag to send a message to everyone in a<br></blockquote><blockquote type="cite">group. &nbsp;The problem is, this group could contain thousands of email<br></blockquote><blockquote type="cite">addresses, and the "publish" routine would simply time out.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is there a way to use a tag that does not have to loop through an email<br></blockquote><blockquote type="cite">list and send out mail and wait until all mail is sent before returning?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I would like to achive the following:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">User publishes new content.<br></blockquote><blockquote type="cite">Content is saved to a table.<br></blockquote><blockquote type="cite">New message data is saved to a "send_message" table.<br></blockquote><blockquote type="cite">Then a daemon can pick that up and send out that message via email on a<br></blockquote><blockquote type="cite">loop. &nbsp;This way a very large list can be managed.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Any advice?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks<br></blockquote><blockquote type="cite">Rick<br></blockquote><br>To solve this kind of problem in the past I've simply handed the job over to <br>the system via the at daemon, and a custom tag to do it. This frees IC to <br>immediately get on with it's main business<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Or... you could hand the email sending to an Interchange child process that performs the job in the background.</div><div><br></div><div>Some months ago we had the need for off-loading heavy processes so the normal flow of things on a page would not be affected by those time consuming processes.</div><div>This has resulted in a child-process tag that we have&nbsp;donated to the Interchange project. This tag is currently part of the core and comes with a simple example (see code).</div><div><br></div><div>Works like a charm for us.</div><div><br></div><div>Ton Verhagen</div><div>Alamerce Nederland</div><div><br></div></body></html>