SHARE
TWEET

Disable autoresponder based on quiz results

chrishajer Mar 17th, 2013 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // http://www.gravityhelp.com/forums/topic/user-notification-email-upon-successful-quiz#post-172441
  3. add_action('gform_pre_submission_filter_289', 'quiz_certificate');
  4. function quiz_certificate($form) {
  5.         // you will have to set $passed to true or false here based on whatever criteria you use for grading
  6.         // lots
  7.         // of
  8.         // code
  9.         // here
  10.         if ( $passed == true ) {
  11.                 // this will send the autoresponder which is already set up
  12.                 return $form;
  13.         }
  14.         else {
  15.                 // clear out any autoresponder values
  16.                 $form['autoResponder'] = array(
  17.                         'toField' => '',
  18.                         'bcc' => '',
  19.                         'fromName' => '',
  20.                         'from' => '',
  21.                         'replyTo' => '',
  22.                         'subject' => '',
  23.                         'message' => '',
  24.                         'disableAutoformat' => '');
  25.                 return $form;
  26.         }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top