WordPress.org

Ready to get started?Download WordPress

Forums

Flamingo
Use different fields for "Subject" and From "Name "? (9 posts)

  1. saas
    Member
    Posted 1 year ago #

    Hi there,
    Is there a way I can set / tell Flamingo that it should check my custom fields for Subject and From name and from email? As not all forms have Subject etc.??? Any thoughts???

    http://wordpress.org/extend/plugins/flamingo/

  2. mirluin
    Member
    Posted 1 year ago #

    +1 for that

  3. danstramer
    Member
    Posted 1 year ago #

    Hi, check out this temporary solution:
    http://wordpress.org/support/topic/subhect-and-date-fields?replies=5

    I hope something better comes along the way

    Dan

  4. saas
    Member
    Posted 1 year ago #

    Nah its not the kind of solution I am looking for. Thanks anyway.

  5. allahjesus
    Member
    Posted 9 months ago #

    Hi,

    You'll have to edit the PHP code in the Flamingo module that's a part of Contact Form 7.

    To do this, you'll need to go to "Plugins" --> "Editor". Then in the top right hand corner, select Contact Form 7 as the plugin you want to edit. Click Select.

    You're looking for "contact-form-7/modules/flamingo.php". Once you click on that file, scroll down close to the bottom, but not all the way. You're looking for the following lines of code:

    $email = isset( $posted_data['your-email'] ) ? trim( $posted_data['your-email'] ) : '';
    $name = isset( $posted_data['your-name'] ) ? trim( $posted_data['your-name'] ) : '';
    $subject = isset( $posted_data['your-subject'] ) ? trim( $posted_data['your-subject'] ) : '';

    These lines set what field name variables that Flamingo is looking for to set the values for the email, name and subject. Simply change the variable in both places of the line for each area that you're trying to adjust.

    In my case, I created a form where people are entering their first name and last name in different fields.

    My new code for those three lines looks like this:

    $email = isset( $posted_data['your-email'] ) ? trim( $posted_data['your-email'] ) : '';
    $first_name = isset( $posted_data['first-name'] ) ? trim( $posted_data['first-name'] ) : '';
    $last_name = isset( $posted_data['last-name'] ) ? trim( $posted_data['last-name'] ) : '';
    $name = $first_name . " " . $last_name;
    $subject = isset( $posted_data['your-subject'] ) ? trim( $posted_data['your-subject'] ) : '';

    This way, Flamingo still interprets their first and last name as one name, but I get the variables to use in my email in different places, such as "Hello [first-name]" in the auto-receipt email that gets sent to them when they submit the form.

    In my case, I didn't need to change the subject variable. Instead, I used the Contact Form 7 Modules plugin to insert a hidden field into the form that sets the subject to a static value.

    However, if you wanted to change it to something else in your form, like "company-name" for a field [company-name], just modify the code above in the appropriate places.

    I've additionally pasted this whole comment into Pastebin to ensure proper syntax just in case this comment doesn't render correctly.

    http://pastebin.com/g9rEVRGm

    I hope this helps. ;)

  6. Eric3D
    Member
    Posted 8 months ago #

    Can we separate this setting from the source code of it doesn't get overwritten every time CF7 is updated?
    In my case, I removed all the 'your-' from name and email to make the forms function better with autofill.

  7. djspur
    Member
    Posted 6 months ago #

    Hi,

    I looked for that code allahjesus but couldn't find it. Maybe there was an update?

    All my results are looking like:

    Subject: [your-subject]
    From: [your-name] <[your-email]>

    And so I can't tell one from the other.... I have made several contact forms and custom fields.

  8. djspur
    Member
    Posted 6 months ago #

    Actually I'd love to remap the subject as well, because in the listing, "your-subject" is the thing you click to see the inbound message, but my form doesn't include a subject.

  9. kn00tcn
    Member
    Posted 3 months ago #

    if you all are still subscribed to this thread, the functionality already exists to control the data that flamingo uses

    http://wordpress.org/support/topic/inbound-messages-wrong-visualization?replies=2#post-5425678

    so in OP's case, as long as you can load your data from a custom field or wherever into the CF7 field ID, & correctly display it in the mail settings or body, then it should work fine with flamingo

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic