WordCamp Europe 2023 Special Offer - Get 30% OFF any edition with coupon: WC30

My Account


Home Forums General How to override existing variables or creating custom variables

Viewing 3 reply threads
  • Author
    • #174726
      Marco Michely

      Hi there,

      in my projects I am using a custom settings page for having sme contact data in one place (created with Metabox.io).
      Now I want to use the e-mail field from this settings page as default form recipient.

      I would like to eighter override #blog_admin_email or to introduce a new custom variable for example #settings_site_email.

      Any ideas and hints how to do that?

      Thanks in advance.

    • #182701
      Mark Westguard

      Hi Marco

      In our send email class we have this filter:

      $email_to = apply_filters('wsf_action_email_to', $email_to, $form, $submit);

      $email_to is an array of email addresses. You could use the wsf_action_email_to filter to change the recipient email address from the admin email address.

      For official support, please use our support page: https://wsform.com/support/



    • #182855
      Marco Michely

      Thanks a lot, Mark!

    • #182863
      Marco Michely

      Here’s an easy solution:

      function mwe_action_mail_to( $email_to ) {
          $admin_email = get_bloginfo('admin_email');
          foreach($email_to as $key => $email) {
              if(str_contains($email, $admin_email)) {
                  $email_to[$key] = "My Name <my@domain.com>";
          return $email_to;
      add_filter('wsf_action_email_to', 'mwe_action_mail_to');
Viewing 3 reply threads
  • You must be logged in to reply to this topic.