Contact Form

Posted in: Modules and Extensions

Contact Form module allows replacing default contact information box on Advert details pages with a contact form (and a phone number if provided next to it).

In order to enable this module go to wp-admin / Classifieds / Options panel and click “Activate” next to “Contact Form” box. If you can’t see this module in Options panel please make sure you are using WPAdverts 1.0.10 or newer.

By default, the Contact Form will look like on the image below

wpadverts-contact-form

Configuration

After Contact Form module activation you will be redirected to this module option or if you left this page you can get to the configuration by going to wp-admin / Classifieds / Options / Contact Form panel.

The configuration panel has few options only.

wpadverts-contact-form-config

The options should be self-explanatory but, let’s look into them a little closer

  • Phone Number – check this checkbox if you want the phone number to be visible on Advert details pages (see first screenshot).
  • From Name – when the email is sent WordPress will set From header to be “WordPress” (unless you are already using some plugin that overwrites this setting). In other words, when user will see this email in his inbox he will see that it was sent by WordPress. This field allows you to use for example your website name instead which will look much more professional.
  • From Email – similar as above, except for email address.

My e-mails are not sent

Most likely the emails are sent but not delivered, this might be especially true if you are manipulating the email headers, some Sendmail software will not allow manipulating email headers and will fail to send the messages without any warning.

When you are having a problem with emails delivery, you can start troubleshooting by installing free Email Log plugin, it will tell you if emails are not sent or not delivered. If they are not sent then this is a problem with WPAdverts and you should contact out support, but usually the email will be in the log, but not your inbox.

If that’s the case you will need to setup email delivery using some SMTP plugin, for example, you can use WP Mail SMTP. Once you have it setup try sending email again.

Integration with Emails Module

Emails Module is available since WPAdverts 1.3.0, if you are using older WPAdverts version then you will need to upgrade to the latest one to use the Emails Module and the Integration with the Contact Form.

Before using this integration please read the Emails Module documentation to learn what it does and how it can make your classifieds site better.

The Payments Module will register in the Emails Module following messages:

on_contact_form_sent

This message is sent when the user submits a contact form from Advert details page.

Variables: {$advert}, {$form}

{$form} variable
{$form.message_name}    (string) - Name entered in "Your Name" field
{$form.message_email}   (string) - Email address enterd in "Your Email" field
{$form.message_subject} (string) - Text entered in "Subject" field
{$form.message_body}    (string) - Text entered in "Message" field

If you have one or more custom fields in the Contact Form then you can access these fields as {$message.custom_field_name} where “custom_field_name” is an actual name of your custom field.