• I am having a webform and I display the 'Save Draft' buttoan on the form.
  • Once I click on the Save draft I need to save all the values in the DB (as it does on Submit event) and should send an e-mail with the submission id (%sid) to the user who works on the form.
  • I don't want to do this using "Webform Rules" module, I want to do this using my Own custom module

Thank you.


Personally I would use webform rules for this. However if you are wanting to do this in a custom module then I suggest you looks at hook_webform_submission_insert or hook_webform_submission_update depending on whether it's a new webform submission or not.

From there you can use modules such as devel to obtain the information on the submission status you require. I haven't worked with 6 for a while now, so I may be wrong here, but I think it's is_draft you need to use. (I haven't got a D6 site to test on). With this information you can write a function to send the mail using drupal_mail

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.