I'd like to run _signup_cron_send_reminders() manually, but don't know how.
My site (www.sandlotsociety.com/dev) is a little league baseball oriented site. Due to COPPA, I am setting it up so that parents register on the site (authenticated users). Then they can buy memberships for their children and sign up their child members for events. Trouble is, If the parent signs up more than one child for an event, they receive a reminder for each of the children (each member's signup is stored as a separate record in signup_log). What I would like to do is modify the signup.module specifically for my site to collect the attendees' names from signup_log.form_data and incorporate those names into the reminder email. Then send only one email for each uid-nid combination in signup_log.
I have an idea how I can bastardize the signup.module to accomplish this; however, in order to develop and test I need to be able to run _signup_cron_send_reminders() on demand with some drupal_set_message() statements sprinkled throughout.
So, my question is, how can I run _signup_cron_send_reminders() by itself? I suppose I could run cron manually; however, I have no need to execute all the functions that cron does while I am testing.
PS: If interested, please feel free to explore the site, register, buy memberships, events, etc. It's still in development, so all entries will be purged before going live. Warning: Do NOT pay for anything with a credit card as you will be charged. Select the payment by check option - and, of course, do NOT mail in any checks.
Comments
Comment #1
dwwYou have *many* options:
A) Install Devel, enable the "Execute PHP" block, and run it manually there.
B) Start to create a node with the PHP input format, and call the function from inside
tags in the body of that node. Every time you preview that node you'll run the function. You could even save the node (you should probably unpublish it) and every time you visit it as an admin, you'll run the function.C) Have a site-specific test module that defines some permission-protected menu item that invokes that function every time you visit a path. Like option (B) but takes a little more work but doesn't use a node.
D) Copy/paste cron.php to signup-debug.php, and instead of having it invoke drupal_cron_run(); have it call _signup_cron_send_reminders() instead.
...
Coming up with another 4 (equally valid) ways to get a drupal site to invoke a function is left as an exercise for the interested reader.
;)
Good luck,
-Derek
Comment #2
PaulWood commentedThanks, Derek. I'll give it a go (probably B).