WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form DB
[resolved] Save "raw" data from Contact Form 7 (4 posts)

  1. Travis Pflanz
    Member
    Posted 1 year ago #

    Hi,

    I have a form set up using the method described in - Selectable Recipient with Pipes.

    The dropdown includes each of the US states, with a salesperson's email address following the pipe.

    [select* state-email
    "Alabama|john@example.com"
    "Alaska|bill@example.com"
    "Arizona|john@example.com"
    "Arkansas|mary@example.com"
    "California|mary@example.com"
    "Colorado|bill@example.com"
    ]

    When the form is submitted, the salesperson's email address is saved to the database. I need the state saved to the database.

    As described in the article, the state can be sent via email using [_raw_state-email], but I cannot seem to find a way to save it to the database.

    I have tried Contact Form 7 Dynamic Text Extension, which states that any shortcode can be used.

    First, I simply tried using simply the [_raw_state-email] shortcode. No luck.

    Next, I created a shortcode using Contact Form DB and _raw_state-email and passed it into a dynamichidden field named state. Still no luck. Only a comma was saved in Contact Form DB for state (I'm not even sure where the comma came from). Contact Form 7 Dynamic Text Extension plugin is old, so I don't know if it doesn't work anymore or if Contact Form DB does not accept _raw_state-email.

    I imagine Contact Form DB does not accept _raw_state-email, otherwise it would already be saved to the database and visible for use... and being it is not accepted, obviously, it cannot be used in a shortcode.

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

  2. Travis Pflanz
    Member
    Posted 1 year ago #

    I also cleared all the field names entered in the Contact Form DB options for - "Do not save fields in DB named"

  3. Michael Simpson
    Member
    Plugin Author

    Posted 1 year ago #

  4. Travis Pflanz
    Member
    Posted 1 year ago #

    Perfect. Thank you. I had been searching for two days.

    I also want to mention, in case someone else comes across this situation -

    In my form, visitors who fill out the form select the state they are located in, then the salesperson who is responsible for that state receives the email. As well, I needed the email to be sent to a central (corporate) email address.

    However, not all states have an assigned salesperson, being the company focuses on the mid-west.

    With Contact Form 7, if the email address after the pipe was empty, emails would not be sent. The method outlined by Michael actually allows an empty field after the pipe.

    I set up "Mail" in the form to send to the central email and "Mail (2)" to send to the salesperson (if one exists).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic