Viewing 1 replies (of 1 total)
  • Plugin Author John Huebner

    (@hube2)

    I created this as part of 3 plugins to do something very similar. Combine this with my hidden field plugin. I think it can also be done using the dynamic text extension.

    Add a hidden field that is populated dynamically, for example: “hidden-post-id” and dynamically populate this with the current post ID.

    add another hidden field to the form with the name “dynamic-mail-to-filter”. This fields value needs to be the name of the filter to run, the “hook” that will be used in apply_filters($hook_name, $recipient, $args)

    create a third hidden field named “dynamic-mail-to-fields”. The value of this field would be “hidden-post-id”. This will be passed to your filter as part of $args.

    In your filter get the recipient value from the post and return it. In this case the first hidden field could be dynamically populated with the exact recipient rather than the post id, but I wouldn’t do that since it will make the email address visible to bots and I’d prefer the first method.

Viewing 1 replies (of 1 total)
  • The topic ‘Specify a custom field to pull recipient email’ is closed to new replies.