I’m not sure how to tell you to do this.
The filter that you need to build for this plugin can use the value of other fields in the form. For example, if you had a hidden field what has the user ID of the current user named ‘user_id’ you can pass the value of that field to the filter in this plugin by including another hidden field named “dynamic-mail-to-fields” with the value “user_id”. Then you can get the user’s email from that in the filter that sets the email address.
There are two fields that this plugin depends on to work and it’s better if both of them are hidden.
The first is the field named “dynamic-mail-to-filter” which sets the hook of the filter to use. For example, if you add_filter('my_dynamic_mailto_filter', 'my_dynamic_mailto_function', 10, 2)
then the value of this field would be “my_dynamic_mailto_filter”.
The second field is the one I mentioned above. The value of this field should be a comma separated list names of any other form fields in the current form whose values you want to pass to the filter. If the value was “user_id,some_other_field” then the value of the second parameter of the filter would be
Array(
[user_id] => 1,
[some_other_field] => some other value
)
hope that helps