PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_pre_send_email not working

  1. Hi - I am trying to use this filter to add some functionality but I'm not getting any response from it. It's in the functions.php file here is the code. Basically i am distributing the messages to different recipients and then keeping a record who got what.

    add_filter("gform_pre_send_email", "rah_leads_gravity");
    function rah_leads_gravity($email){
    
    	// Interaction with message data
    	$thisEmailAddress = get_option('nextLead');
    	$email["to"] = $thisEmailAddress;
    	$senderEmail = $email["from"];
    	$senderSubject = $email["subject"];
    	$timeSent = time(); 
    
    	// Queue next email address
    	rah_leads_update_queue($thisEmailAddress);
    
    	//Update message list
    	global $wpdb;
    	$wpdb->insert('wp_rah_leads_messages', array(
    			toEmail => $thisEmailAddress,
    			fromEmail => $senderEmail,
    			emailTitle => $senderSubject,
    			emailDate => $timeSent
    			));
    
    	return $email;
    }

    http://www.gravityhelp.com/documentation/page/Gform_before_email

    Posted 11 years ago on Wednesday April 3, 2013 | Permalink
  2. David Peralty

    This filter is only available for 1.7+. Are you using our 1.7 Beta 2?

    Posted 11 years ago on Thursday April 4, 2013 | Permalink
  3. Hi,

    I'm using 1.7 Beta 2 and this is not working for me. Even something simple, like the example below, does not work.

    add_filter("gform_pre_send_email", "route_email");
    function route_email($email){
    	$email['to'] = 'name@domain.com';
    	return $email;
    }

    I don't know whether to use gform_pre_notification_save or gform_notification. Can you guys help me understand the proper way to do this?

    Posted 11 years ago on Friday April 5, 2013 | Permalink
  4. David Peralty

    I'm going to check with the developers to see what's going on with this. Please be patient.

    Posted 11 years ago on Friday April 5, 2013 | Permalink
  5. David Peralty

    The developers tested what you have and it worked fine for them. I would like to send you our logging add-on to see if it can pinpoint the source of the issue. If that's okay, can you send me an e-mail at peralty@rocketgenius.com please?

    Posted 11 years ago on Tuesday April 9, 2013 | Permalink