I really need the functionality of the RSVP module , but it is not ready for Drupal 5.x yet. I am on a deadline, as this is to track the RSVPs for my wedding.

I have built a form for a standard page node, using PHP filtering. I really like the ease that I could do it, but how can I collect the data being submitted? Ideally it would be thrown in the database, but I cannot seem to find the documentation for that. I really don't want to build a whole module for this, as doing so would take too long. If adding to the db is not possible (via The Drupal Way), may I specify an email address for the results to be sent? I am using 5.1.

Please help! I have read the Forms API documentation, but I didn't see anything about saving or emailing the results. Did I miss something?

Comments

deavidsedice’s picture

I'll try to give you a bit of help.

You want a form that collects some data, saves it, and send it by email.
I think that this is very easy, if you combine the CCK module with a new module.
CCK allows you to create the fields easily. With this you will have a form that saves all the data you want to the database.

About reading the saved data and sending an email, you will need to create a module. Only for one function: hook_nodeapi.
http://api.drupal.org/api/5/function/hook_nodeapi

Try a code like this:

function mysmallmodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { 
   if ($node->type!="email_node_type") return; // Make sure that you have the right type of node.
   if ($op=='insert') {  // It seems that someone is saving a node.
     // highlight_string('<? $node = ' . var_export($node,1));   // Use this line if you want to see the vars being saved into DB.
     // Add mailing your code here.
  }

To send an email, you can use:
http://api.drupal.org/api/5/function/drupal_mail

But, of course, you can use the SMTP project module to send the emails.

scoutbaker’s picture

Status: Active » Fixed

The RSVP module is available for 5.x now of course.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.