WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / Email : Extra parameters on contact form email

Email : Extra parameters on contact form email

4094 views 0

Question:  Is there a way using your custom form or to pull the listing page metadata into the email? Example: Listing Title: Price: Property ID: Property Address:

Answer : The answer is yes. You need to edit the file  misc/emailfunctions.php from  theme plugin:  wpresidence-core.

In there you have function wpestate_ajax_agent_contact_form.

There is 2 types of emails – HTML or text

If you send HTML – add the extra attributes at line 230

$attributes=array(
‘name’ => $name,
’email’ => $email,
‘phone’ => $phone,
‘subject’ => stripslashes( $subject ),
‘content’ => stripslashes( $comment_striped ),
‘sent_from’ => $permalink,

// new attribute – adding property addres

‘property_address’ => get_post_meta($propid,’property_address’,true);
);

Then edit templates/email_templates/contact_email_template.php added inside the email using this code {property_address}

 

If you are sending text email

Add the new info to the $message variables

$message .= esc_html__(‘Address’,’wpresidence-core’).”: ” . $get_post_meta($propid,’property_address’,true) . PHP_EOL;

Technical how to | Custom Code

Related Articles

  • How to Add Custom Fields to the Login, Register and Forgot Password Forms
  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
MLSImportWordPress IDX Plugin for MLS ListingsImport MLS listings into your WordPress website, customize your property pages, and keep your inventory updated.Start free 30-day trial →

Help Categories

  • 111 Installation & Changelog
  • 19Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 14Footer
  • 38Header
  • 2IDX & MLSImport
  • 23Maps & Location Settings
  • 50Multilingual Websites – WPEstate Translate (Included)
  • 21Pages & Page Templates
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 38Property Single Page
  • 32Search & Filtering
  • 170Technical how to | Custom Code
  • 9Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 6Theme Translation & Localization
  • 28Third Party Plugins Compatible
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 9WPResidence Elementor Studio
  • 39WPResidence Elementor Widgets
  • 79WPResidence FAQ

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API