Advertisement
chrishajer

prepend text to autoresponder for some forms

Dec 21st, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. // http://www.gravityhelp.com/forums/topic/add-text-to-specific-form-notification-emails
  3. add_filter('gform_pre_submission_filter', 'brad_prepend_text');
  4.  
  5. function brad_prepend_text($form) {
  6.     // array of form IDs where we want to modify the autoresponder. Use your form IDs here
  7.     $form_ids = array (1,17,4,5);
  8.  
  9.     // if our form is not in the array, just return
  10.     if (!in_array($form['id'], $form_ids)) {
  11.         return $form;
  12.     }
  13.  
  14.     // add your message to the beginning of the autoresponder
  15.     $form['autoResponder']['message'] = '<p>Thank you for contacting WebDevStudios.  We love you!</p>' . $form['autoResponder']['message'];
  16.  
  17.     // return the modified form object
  18.     return $form;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement