I really don't need any more work to do, yet I am considering finishing and submitting a module to drupal..org. The module relies on mime_mail and provides a UI to mail a node to a subscriber list. It utilizes an AJAX script to loop through the subscriber list and send each mail. Currently the module is a bit of a hack as the AJAX script resides in the docroot. I would like advice as to how to place the script in the module folder and still invoke drupal_bootstrap() without file path errors. Thanks so much :-) Dayton Perkins Tuesday, June 01, 2010
Why not try using the Batch API instead? On 01/06/2010, at 2:56 PM, Dayton Perkins wrote:
I really don't need any more work to do, yet I am considering finishing and submitting a module to drupal..org. The module relies on mime_mail and provides a UI to mail a node to a subscriber list. It utilizes an AJAX script to loop through the subscriber list and send each mail. Currently the module is a bit of a hack as the AJAX script resides in the docroot. I would like advice as to how to place the script in the module folder and still invoke drupal_bootstrap() without file path errors. Thanks so much :-)
Dayton Perkins Tuesday, June 01, 2010
On 2010-06-01, at 2:09 AM, Chris Skene wrote:
Why not try using the Batch API instead?
Better yet, use http://drupal.org/project/job_queue so that your user doesn't have to wait for each email to be sent. --Andrew
I think queue is a good suggestion. There was a great preso at drupalcon sf by jvandyk re: batch v. queue, in case you wanted a high-level on the typical use cases for each. http://sf2010.drupal.org/conference/sessions/batch-vs-queue-api-smackdown On Tue, Jun 1, 2010 at 10:58 AM, Andrew Berry <andrewberry@sentex.net>wrote:
On 2010-06-01, at 2:09 AM, Chris Skene wrote:
Why not try using the Batch API instead?
Better yet, use http://drupal.org/project/job_queue so that your user doesn't have to wait for each email to be sent.
--Andrew
Hi, Actually I would not use node_queue, but instead use http://drupal.org/project/drupal_queue which is a backport of the Drupal Queue system. Upgrading will be a lot less painful. Gordon. On 02/06/2010, at 12:58 AM, Andrew Berry wrote:
On 2010-06-01, at 2:09 AM, Chris Skene wrote:
Why not try using the Batch API instead?
Better yet, use http://drupal.org/project/job_queue so that your user doesn't have to wait for each email to be sent.
--Andrew
When you say "node_queue" you mean job_queue? I don't think Nodequeue is relevant in this context. I do agree that to "future proof" your code using the Queue module is a good choice. Cheers, Greg On Tue, Jun 1, 2010 at 9:46 AM, Gordon Heydon <gordon@heydon.com.au> wrote:
Hi,
Actually I would not use node_queue, but instead use http://drupal.org/project/drupal_queue which is a backport of the Drupal Queue system. Upgrading will be a lot less painful.
Gordon.
On 02/06/2010, at 12:58 AM, Andrew Berry wrote:
On 2010-06-01, at 2:09 AM, Chris Skene wrote:
Why not try using the Batch API instead?
Better yet, use http://drupal.org/project/job_queue so that your user doesn't have to wait for each email to be sent.
--Andrew
-- Greg Knaddison | 303-800-5623 | http://growingventuresolutions.com Mastering Drupal | http://www.masteringdrupal.com
Note that both batch API and D7 queue have examples in the Examples project, http://drupal.org/project/examples. -Randy On Tue, Jun 1, 2010 at 9:46 AM, Gordon Heydon <gordon@heydon.com.au> wrote:
Hi,
Actually I would not use node_queue, but instead use http://drupal.org/project/drupal_queue which is a backport of the Drupal Queue system. Upgrading will be a lot less painful.
Gordon.
On 02/06/2010, at 12:58 AM, Andrew Berry wrote:
On 2010-06-01, at 2:09 AM, Chris Skene wrote:
Why not try using the Batch API instead?
Better yet, use http://drupal.org/project/job_queue so that your user doesn't have to wait for each email to be sent.
--Andrew
-- Randy Fay Drupal Module and Site Development randy@randyfay.com +1 970.462.7450
Move your code to the right place and it will start working correctly. :) Seriously though, the module framework in Drupal was designed so that you didn't need to do clumsy hacks like that in 99% of all scenarios. Learn how to do things the right way and you will save yourself a LOT of hassle. -Cameron On Mon, May 31, 2010 at 10:56 PM, Dayton Perkins <perkinsd@chartermi.net> wrote:
I really don't need any more work to do, yet I am considering finishing and submitting a module to drupal..org. The module relies on mime_mail and provides a UI to mail a node to a subscriber list. It utilizes an AJAX script to loop through the subscriber list and send each mail. Currently the module is a bit of a hack as the AJAX script resides in the docroot. I would like advice as to how to place the script in the module folder and still invoke drupal_bootstrap() without file path errors. Thanks so much :-)
Dayton Perkins Tuesday, June 01, 2010
On Tuesday 01 June 2010, Dayton Perkins wrote:
I really don't need any more work to do, yet I am considering finishing and submitting a module to drupal..org. The module relies on mime_mail and provides a UI to mail a node to a subscriber list. It utilizes an AJAX script to loop through the subscriber list and send each mail. Currently the module is a bit of a hack as the AJAX script resides in the docroot. I would like advice as to how to place the script in the module folder and still invoke drupal_bootstrap() without file path errors. Thanks so much :-)
Dayton Perkins Tuesday, June 01, 2010
Put your script in a function in your module and a MENU_CALLBACK in your hook_menu() so it can be reached, use drupal_json() to return any results and some javascript using jquery get() to submit the request to the function via the path in hook_menu(). In the function you can use $_GET to collect the query string, remember to run any user supplied input through check_plain(), test for valid email addresses etc. You might also want to consider using serverside mailinglist software such as mailman or ezmlm. -- ----------------- Bob Hutchinson Midwales dot com -----------------
participants (9)
-
Andrew Berry -
Bob Hutchinson -
Brian Fending -
Cameron Eagans -
Chris Skene -
Dayton Perkins -
Gordon Heydon -
Greg Knaddison -
Randy Fay