Dynamic Recipient for Contact Form 7 | John A. Huebner II | adopt-me

Dynamic Recipient for Contact Form 7 | John A. Huebner II | adopt-me,contact form 7,Dynamic,recipient

Description

Addopt this plugin. Please see details on Github.

Dynamically set recipitent of mail using a filter.

How To Use

Create a filter that will return the recipient of mail. For more information see the example filter in
cf7-dynamic-mail-to-examples.php included with the plugin.

function wpcf7_dynamic_to_filter_example($recipient, $args=array()) {
  if (isset($args['select-email'])) {
    if ($args['select-email'] == 'send to email 1') {
      $recipient = '[email protected]';
    } elseif ($args['select-email'] == 'send to email 2') {
      $recipient = '[email protected]';
    } elseif ($args['select-email'] == 'sent to email 3') {
      $recipient = '[email protected]';
    }
  }
  return $recipient;
} // end function wpcf7_dynamic_to_filter_example
add_filter('wpcf7-dynamic-recipient-example-filter', 'wpcf7_dynamic_to_filter_example', 10, 2);

Add special fields to your form, see screenshot of example fields.

Add a field to you form with the name “dynamic-mail-to-filter”. This can be any type of field that holds
a single value. I would suggest trying out my other plugin
Contact Form 7 – Simple Hidden Field.
You can also use another hidden field extension for CF7. Set the value of this field to the name of your
filter hook.

If you would like the values of other fields sent to your filter as arguments, add a field with the name of
“dynamic-mail-to-fields.” Set the value of this field to a comma separated list of the fields values you
want sent to your filter. Again, see the example filter supplied with this plugin.

Installation

  1. Upload the files to the plugin folder of your site
  2. Activate it from the Plugins Page

Plugin author

John A. Huebner II

Plugin official website address

https://wordpress.org/plugins/contact-form-7-dynamic-mail-to/
If you encounter problems in using the Dynamic Recipient for Contact Form 7 plugin, you can comment below, and I will try my best to help you solve the problem

Leave a Comment

Your email address will not be published. Required fields are marked *