Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://www.gravityhelp.com/forums/topic/conditional-logic-for-user-notifications
- // update the "2" to the ID of your form
- add_filter('gform_pre_submission_filter_2', 'conditional_message');
- function conditional_message($form){
- // update the "7_1" following "input_" to the IDs of your fields
- $choice1 = RGForms::post('input_7_1');
- $choice2 = RGForms::post('input_7_2');
- $choice3 = RGForms::post('input_7_3');
- // if any box was checked, say thank you. Since field is required, this will always test TRUE
- if($choice1 || $choice2 || $choice3)
- $form['autoResponder']['message'] .= "Thank You";
- // append a different PDF link based on the interest
- if($choice1)
- $form['autoResponder']['message'] .= "<p><a href='http://kreatorsafety.com/uploads/belt_guard.pdf' title='Download your free Belt Guard Data Sheet'>BELT GUARD DATA SHEET DOWNLOAD</a></p>";
- if($choice2)
- $form['autoResponder']['message'] .= "<p><a href='http://kreatorsafety.com/uploads/coupling.pdf' title='Download your free Safety Guard Data Sheet'>COUPLING GUARD DATA SHEET DOWNLOAD</a></p>";
- if($choice3)
- $form['autoResponder']['message'] .= "<p><a href='http://kreatorsafety.com/uploads/K.S.Catalogue.pdf' title='Download your free Catalogue here'>SAFETY GUARD CATALOGUE DOWNLOAD</a></p>";
- // return modified form
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement