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.

Autoresponder based on dropdown selection

  1. We need a form which will contain a list of topics which person might choose to receive more information on.

    We want it to be presented in a dropdown box so they can only select 1. Based on their selection, we need the autoresponder to include a download link which corresponds with their selection.

    Is this doable and what is the skill level needed to set this up?

    Posted 12 years ago on Sunday March 4, 2012 | Permalink
  2. Hi, bt-chadski,

    Yes, this is doable. You would need to use one of Gravity Forms' hooks to modify the notification message being sent. If you were simply conditionally sending to a different email address based on the selection, it could be done in the admin. But, since you are modifying the content of the email, you would use the "gform_pre_submission_filter" (http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter). You would add some code to check the drop down and build your message with the link based on the selection. Below is a quick example of modifying the message:

    add_action("gform_pre_submission_filter", "change_autoresponder");
    function change_autoresponder($form){
    	$new_message = "This is a test changing the autoresponder in the pre submission filter";
    	foreach($form["fields"] as &$field)
    	{
    		//do this for a specific field
    		if ($field["id"] == 5)
    		{
    			$input_name = "input_" . $field["id"]; //get name of form field
    			$fieldname = $field["label"]; //get field label
    			$value = $_POST[$input_name]; //get value of field out of the post data
    			if (!empty($value))
    			{
    				//there is a value, add field to user autoresponder message - "\r\n" is a carriage return line feed
    				$new_message .= "\r\n" . $fieldname . " - " . $value;
    			}
    		}
    	}
    	//change autoresponder in form to new one
    	$form["autoResponder"]["message"] = $new_message;
    	//return form so changes are applied
    	return $form;
    }

    So, there are a lot of existing examples out there which can make things like this very easy to do. We can help guide you in the right direction if you have problems.

    Take a look and let me know if you have questions.

    Posted 12 years ago on Monday March 12, 2012 | Permalink

This topic has been resolved and has been closed to new replies.