[development] Module dev...

Bob Hutchinson hutchlists at midwales.com
Tue Jun 1 13:36:25 UTC 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
-----------------


More information about the development mailing list