Advertisement
chrishajer

Disable autoresponder based on quiz results

Mar 17th, 2013
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement