Re: [Zope] using zope for broadcast e-mail messages...
chas wrote Zope's dtml-sendmail tag is excellent - it makes sending e-mail a breeze. It reminds me of a similar tag that Cold Fusion added and which I've noticed many sites use for sending out customized newsletters (the "Allaire ColdFusion Application Server" header being the giveaway).
Now, doing the same in Zope, I can loop over the user profiles in our database to extract name, e-mail, and even customize the content of the newsletter as follows :
<dtml-in ZSQL_Select_User_Profiles>
<!--#sendmail mailhost="ZMailHost"--> To: <dtml-var firstname> <<dtml-var email>> From: robot <robot@ourdomain.com> Subject: <dtml-var random_inanity>
Dear <dtml-var firstname>,
blah blah content (also dependent on his/her likes/preferences)
<!--#/sendmail-->
</dtml-in>
Nothing groundbreaking so far. But the question then is : how is this going to work if the user database numbers 200,000+ ? It will take almost half a day to complete and this can't be done in one form-submission or page load !
Why not use ZClient to make the request to do the mailout? It can just happily sit there for half a day (or whatever) chugging along, without screwing up if your browser goes away. Anthony -- Anthony Baxter <anthony@interlink.com.au> It's never too late to have a happy childhood.
Why not use ZClient to make the request to do the mailout? It can just happily sit there for half a day (or whatever) chugging along, without screwing up if your browser goes away.
Have considered it : but a script employing ZClient takes me back to python scripts (which I already have). Admittedly, Zope + ZClient would make it easier to manage than my current system but it would still require me initiating this by logging in via ssh. What I didn't mention is that I'm incredibly lazy and am currently the bottleneck in our company for mailing news- -letters. :( I wish to create a system (hopefully around Zope) so that our content-author or editor can write the newsletter, paste it into a textarea in a form, add a subject line and hit "send". It will then start to be sent to the 200,000+ members. Then the said content-author could check back regularly to see the status (again via a web-page). But you've got me thinking (which is always a start), Anthony, perhaps the following will work : 1. Rewrite my scripts to use ZClient.. I can continue to initialize this from the shell for the time being. This script already logs the progress in case of crash. 2. Add a web-interface to it using os.popen or something equally kludgy. I'll play with that until better ideas come along - but it seems like a useful product to build properly so I do welcome any input regarding features etc. Thank you, chas
Going back about 10 months to a problem I had before. Goal: an end-user fills in a form on a webpage and clicks the 'submit' button. As a result, thousands of customized e-mail messages are sent. Problems: (i) The msgs are customized so Mailman is not appropriate. also, there is substantial workflow so Zope is preferred. (ii) The end user only uses a web browser - s/he will not be expected to log in and use ZClient, so the previous solution suggested below is not viable. (iii) The confirmation webpage must return immediately... ie. we do not want to wait for all the emails to be sent before the page is returned to the user. This has to be processed in the background (perhaps for the next hour or so, even if the user logs off). Possible scenario : user logs on, fills in form, hits 'submit', confirmation webpage is returned to the user saying it's ok, emails start to get sent out, user logs off, emails continue to get sent out, user logs back on 2 hrs later and its still processing. Anyone any ideas on this one ? Thanks a lot, cheers, chas
chas wrote Zope's dtml-sendmail tag is excellent - it makes sending e-mail a breeze. It reminds me of a similar tag that Cold Fusion added and which I've noticed many sites use for sending out customized newsletters (the "Allaire ColdFusion Application Server" header being the giveaway).
Now, doing the same in Zope, I can loop over the user profiles in our database to extract name, e-mail, and even customize the content of the newsletter as follows :
<dtml-in ZSQL_Select_User_Profiles>
<!--#sendmail mailhost="ZMailHost"--> To: <dtml-var firstname> <<dtml-var email>> From: robot <robot@ourdomain.com> Subject: <dtml-var random_inanity>
Dear <dtml-var firstname>,
blah blah content (also dependent on his/her likes/preferences)
<!--#/sendmail-->
</dtml-in>
Nothing groundbreaking so far. But the question then is : how is this going to work if the user database numbers 200,000+ ? It will take almost half a day to complete and this can't be done in one form-submission or page load !
Why not use ZClient to make the request to do the mailout? It can just happily sit there for half a day (or whatever) chugging along, without screwing up if your browser goes away.
Anthony
On Thu, 23 Nov 2000, chas wrote:
Goal: an end-user fills in a form on a webpage and clicks the 'submit' button. As a result, thousands of customized e-mail messages are sent.
Problems: (i) The msgs are customized so Mailman is not appropriate. also, there is substantial workflow so Zope is preferred. (ii) The end user only uses a web browser - s/he will not be expected to log in and use ZClient, so the previous solution suggested below is not viable. (iii) The confirmation webpage must return immediately... ie. we do not want to wait for all the emails to be sent before the page is returned to the user. This has to be processed in the background (perhaps for the next hour or so, even if the user logs off).
Possible scenario : user logs on, fills in form, hits 'submit', confirmation webpage is returned to the user saying it's ok, emails start to get sent out, user logs off, emails continue to get sent out, user logs back on 2 hrs later and its still processing.
Anyone any ideas on this one ? Thanks a lot,
You might want to take a look at my bulk mailing how-to http://www.zope.org/Members/shh/BulkMailHack/ Regards, Stefan
Thanks Stefan, Nice analysis - esp. of the locking problems which explains why I wasn't managing to scale with multiple threads, even from a straight python script (no Zope). Pretty certain I'm going to botch up qmail if I start writing directly to the maildrop, but will investigate. As for my initial question (detaching the sending thread from the interactive part of Zope), I'm relieved to see that the 'threading' module is taking care of everything for you ... I must have screwed up in my earlier attempts (using 'thread'). Will give it another shot now that I know this is the way to go forward. Cheers, chas
You might want to take a look at my bulk mailing how-to http://www.zope.org/Members/shh/BulkMailHack/
Regards, Stefan
Goal: an end-user fills in a form on a webpage and clicks the 'submit' button. As a result, thousands of customized e-mail messages are sent.
Problems: (i) The msgs are customized so Mailman is not appropriate. also, there is substantial workflow so Zope is preferred. (ii) The end user only uses a web browser - s/he will not be expected to log in and use ZClient, so the previous solution suggested below is not viable. (iii) The confirmation webpage must return immediately... ie. we do not want to wait for all the emails to be sent before the page is returned to the user. This has to be processed in the background (perhaps for the next hour or so, even if the user logs off).
Possible scenario : user logs on, fills in form, hits 'submit', confirmation webpage is returned to the user saying it's ok, emails start to get sent out, user logs off, emails continue to get sent out, user logs back on 2 hrs later and its still processing.
Anyone any ideas on this one ? Thanks a lot,
participants (3)
-
Anthony Baxter -
chas -
Stefan H. Holek