• Resolved ste9890

    (@ste9890)


    Hi there,

    Is it possible to change which email address the form gets delivered to based on a value from the form?

    For example, we have options in the form for ‘Purchase’ and ‘Hire’ and we want to deliver the email to sales@ or hire@ based on that option choice.

    Any help would be appreciated.

    Thanks,
    Ste

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes! You can use field values in the Email To field.

    For example, the To field can be [DEPARTMENT]@mc4wp.com

    And then in the form you would have

    <select name="DEPARTMENT" required id="department">
        <option value="" disabled selected hidden>Select</option>
        <option value="support">Support</option>
        <option value="admin">Administration</option>
      </select>

    I do strongly recommend to not set the whole email address dynamically, as that would allow someone to send emails to arbitrary addresses via your site. That is why in the above example the domain is “hard coded” and only the part before the @ sign is dynamically set by the website visitor.

    Hope that helps. If you have any questions, please let me know!

    Thread Starter ste9890

    (@ste9890)

    Ah that’s amazing – I almost didn’t bother asking because I was sure it wouldn’t be possible!

    Big thanks for your help and the speedy response!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change Email Recipient Based on Field Value’ is closed to new replies.