• Resolved chemboy

    (@chemboy)


    hello postie people

    i’ve set up an online form using contact form 7 that posts to my secret postie email address. each email gets collected and listed in draft format for moderation.

    the category i’m using is one called testimonials that comes with my theme, which doesn’t have a body section as such, instead it has four custom fields – ‘author_name’, ‘author_company’ [not required], ‘author_url’ [also not required] and ‘author_quote’.

    what i would like to do is have postie auto-fill the author_name and author_quote fields instead of trying to fill the [non-existent] body, using the your-name and your-message fields in contact form 7

    do you think this would be possible?

    great plugin btw

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chemboy

    (@chemboy)

    …i tried tweaking this function in the filterPostie.php file to see if it would work, but no

    function add_custom_field($post) {
    if (‘testimonials’ == get_post_type()) {
    add_post_meta($post[‘ID’], ‘pyre_author_name’, ‘$your_name’);
    add_post_meta($post[‘ID’], ‘pyre_author_quote’, ‘your-message’);
    return $your_name;
    return your-message;
    }
    }

    Plugin Author Wayne Allen

    (@wayneallen-1)

    How you do this would depend on details regarding your contact7 form, the email it sends and how the theme works.
    In general you’d use the postie_post_before filter https://postieplugin.com/postie_post_before/ and parse the email for the required data then call add_post_meta.

    Thread Starter chemboy

    (@chemboy)

    that’s very interesting, wayne

    i’ll give it a go and see how i get on

    thanks for the pointer

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘inject email name and body into metaboxes’ is closed to new replies.