Agent Contact Form & Contact Form 7

How Can We Help?

Agent Contact Form & Contact Form 7

An agent contact form is displayed in two places by default.

  1. Single Property Page
  2. Agent Page

You can set up its settings by going to Settings -> Agent Contact Form but at some point, you may need to customize it. You may want to add some fields into the contact form or want to remove the default ones. It’s not a good idea for us to develop a separate system to manage contact forms and their fields, so let’s leave it to other famous plugins. Real Estate Manager has support for 3rd party contact form plugins also. We will take the Contact Form 7 as an example here.

First, you have to create a form using contact form 7, follow its documentation. After creating a form you will get a shortcode to render that form. Suppose it is

[contact-form-7 id="1234"]

Now go to Users -> Your Profile -> Contact Form Shortcode and paste that shortcode here. Now when you will visit your properties or will visit your profile page, this form will render. That’s it.

Using Special Tags

As you know you can use the special tags in the default form to get Property URL, ID, etc. So, you may want to get these with the Contact Form 7 also. For this purpose, you can use one of the following methods

  1. Using plugin Contact Form 7 Dynamic Text Extension
  2. Adding some code in your theme’s functions.php file (Using the Hook wpcf7_before_send_mail)

1. Using Contact Form 7 Dynamic Text Extension

Make sure you have installed and activated both Contact Form 7 and Contact Form 7 Dynamic Text Extension Plugins.

Display Property Title in the Contact Form

There are two steps involved

  1. First, make a hidden field in the form using dynamichidden tag
  2. Then use it in the actual message.

Go to your Contact Form 7 form and edit it. On the Form, tab paste the following code

[dynamichidden property-title "CF7_get_post_var key='title'"]

Now go to the Mail tab and paste the following where you want to display the Property Title

[property-title]

Similarly, you can display the Property URL using

[dynamictext property-url "CF7_URL"]

and any custom field data of the current property using

[dynamictext property-price "CF7_get_custom_field key='rem_property_price'"]

2. Using the Hook wpcf7_before_send_mail

We’re working on this part and will update this document soon.