Lucia
Lucia

Reputation: 614

Drupal Webform values before submit

I'm using Drupal 7, Webform 3.19 and CiviCRM 4.3.

I am using webforms to update CiviCRM information. What I'm trying to do know is to send an email after a webform has been submitted with the values after submit and values before submit, to notify the change done.

Is this possible? I've also been looking at Rules and I have found nothing...

Thx

Upvotes: 1

Views: 930

Answers (1)

Andie Hunt
Andie Hunt

Reputation: 705

The short answer is that you'll need to write a custom Drupal module or CiviCRM extension.

It would use hook_civicrm_pre and would have to distinguish between updates coming from your webform and updates coming from normal backend work. There may be some other hook for Webform that is called pre-saving that you could use for that. (hook_form_alter would allow you to add something to process pre-saving, but there's no sure way to know that you're getting the same contact ID as Webform does). Regardless, your module/extension would need to retrieve the relevant fields from the existing content and email it to you along with the form values.

You could alternatively enable CiviCRM's logging feature, but this will often cause problems with database bloat and upgrade headaches. (Which is why it's labeled as a beta feature years after it was introduced.)

A final option could be to only send this when there are defaults provided (i.e. only if someone is logged-in or using the checksum). There, you'd still need to write a custom module, but it could be more reliable in pulling the right contact's information.

Upvotes: 3

Related Questions