Plugin Support
Bruce (a11n)
(@bruceallen)
Happiness Engineer
Hi @hearvox
I’m not sure I quite understand what you’re trying to accomplish. Can you give me the example usage of this? Like an overview of how this would work?
We’re happy to help, we just need a little more information to see how we can best assist you!
Sorry, I wasn’t clear. We at college/community radio station KGLT.net are building a new site. For the Contact page we’d like to use a single Jetpack Contact Form that allows the user to choose which staff member receives the form-submission info (via email). Here’s the barebones page with the form we’re testing:
https://kgltradio.com/about/staff/
The select pulldown, labeled “To:”, has the user-selectable options for the recipient (“General Manager”, “Music Director”, etc.). Using Jetpack’s content_form_subject
filter, I can set the subject line of the email the staff member receives based the user-selected pulldown value (e.g., if val is “Music Director”, I set subject to “KGLT Music Director contact”). That’s easy because the filter passes all the user’s form-field values (in var $all_values
, which includes that of the “To:” select pulldown).
But the contact_form_to
filter passes no user-entered values, only the form’s recipient (i.e., $to
, preset in the page’s Block editor.) So I can’t get user’s “To:” selection, for setting email recipient. Nor I can’t find any hook that fires before contact_form_to
that passes all the user’s form-field values, which I need to set recipient.
Rather the write the form myself (or use another form plugin), I’d like to stick with Jetpack’s Contact Form, which we use elsewhere on site too: It’ll be easier for station to maintain/learn just one form plugin. Plus I really like how Jetpack’s integrates with Akismet and admin-lists under Feedback.
So, any way to grab the user-selected value of the form’s pulldown before contact_form_to
fires? Or any way to otherwise set the email recipient based on that user-selection? (Hope I’ve explained better this time.)
Hi @hearvox
Thanks for providing that explanation! It makes absolute sense to me what you are looking to achieve now; however, we won’t be able to provide support with that as customization that involves custom development and coding is outside of our support scope.
You may use the Jetpack Codex to find and search for filters related to the contact form, and you can also submit a Github issue as a Feature request related to your specific use case (of offering dropdown options to contact different people).
Best,
Feature request submitted. Thanks for your help and suggestion.