WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Pass value to subject ? (12 posts)

  1. astrasuite
    Member
    Posted 2 years ago #

    We use a contact form 7 for each product we sell at our website.

    Like here :

    http://www.astrasuite.com/astrablog/2012/01/19/used-hifi-for-sale-horning-hybrid-eufrodite-mk3-loudspeakers/

    Sometimes, people who use the contact form forget to put in the subject, they assume that the contact form is smart enough to fill it up for them when they submit.

    Is there a way to pass a subject by default each time the page/post is accessed ? Then when they are filling it up to enquire, they don't have to worry about the subject. Then we can pass the relevant default subject to a contact form depending on the which page it is located.

    Thanks

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

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    Special Mail Tags

    Use [_post_title] in your mail.

  3. astrasuite
    Member
    Posted 2 years ago #

    Arigato, Takayuki-san ...

    That helps a lot, thanks for the link.

    It does not work when the contact form is under widgets, but works fine when within the post (or probably a page). When contact form is a widget, the result for example shows as "[_post_url]", literally, not the actual URL.

    It's fine, I just moved the contact form to a location within the post. Of course, it would be nice if it works too when cf7 is a widget, for other purposes.

    Thanks

  4. petherika
    Member
    Posted 2 years ago #

    I have almost the same problem. I have several products on the same page. Each product has a form.

    Is it possible to add something to the
    [contact-form-7 id = "27" title = "Product-form"] like
    [contact-form-7 id = "27" title = "Product-form" mailtag = "Product 1456 "].
    And that I can use it in an email with the tag [mailtag]

    Thanks

  5. DateTec
    Member
    Posted 2 years ago #

    Could some please tell me where exactly in the settings do I add this
    [_post_url] in order for the url of the post where the contact form was sent from to be sent to me?

  6. petherika
    Member
    Posted 2 years ago #

    I did not see that this issue was marked resolved so I start a new thread instead.

    New post: Can you add a variable to the short code?

  7. petherika
    Member
    Posted 2 years ago #

    Could some please tell me where exactly in the settings do I add this
    [_post_url] in order for the url of the post where the contact form was sent from to be sent to me?

    I suppose you put it in the message field. Go to wpcf7 settings (Contact).

  8. DateTec
    Member
    Posted 2 years ago #

    Tried that and I just get the [_post_url] literally showing like that not the actual url that its submitted from.

  9. astrasuite
    Member
    Posted 2 years ago #

    put it in the message body, under Contact settings:

    Here is an example, mine, last 2 lines:

    From: [text-60] <[email-562]>
    Subject: [text-70]

    Message Body:
    [your-message]

    --
    This mail is sent via contact form on Astra Suite News http://www.astrasuite.com/astrablog
    [_post_title]
    [_post_url]

    This only works when contact form is in a post or page. If it is a widget in a sidebar, it will just return what DateTec got.

  10. DateTec
    Member
    Posted 2 years ago #

    Thanks, but thats how I had it set but its not getting me the actual url.

    Its not in a widget in a sidebar as no widgets are set at all.

    I am adding the shortcode through an admin setting in the theme options so it appears in every "property listing"
    It seems too be calling it on here single-listing.php with this code
    <?php echo do_shortcode($agentcontactform); ?>

    So I am guessing its not a widget.

  11. astrasuite
    Member
    Posted 2 years ago #

    Well, I don't know about the theme options.

    Try putting the shortcode on a post or page i.e. type it there, outside whatever theme admin setting. That's how I do it, so you seem to be doing it differently.

    If it works, then go ask your theme designer why it doesn't work in their theme admin settings.

  12. DateTec
    Member
    Posted 2 years ago #

    It works fine that way, I have asked theme designer. Many thanks for your assistence.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic