WP Residence Help WP Residence Help

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

Email : Extra parameters on contact form email

3991 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 Required

Related Articles

  • 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
  • Introduction to WPResidence Header Customization

Help Categories

  • 18Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 39Elementor Shortcodes Built-In
  • 53FAQ
  • 15Footer
  • 5Getting Started
  • 37Header
  • 2IDX & MLSImport
  • 6Installation & Setup
  • 24Installation FAQ
  • 23Maps & Location Settings
  • 21Multi-Language - Third Party Plugins
  • 6Other Third party Plugins
  • 21Pages
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 37Property Pages & Layouts
  • 32Search & Filtering
  • 162Technical how to | Custom Code Required
  • 8Technical: Actions and filters
  • 7Technical: Child Theme
  • 86Theme Options & Global Settings
  • 7Translations & Languages
  • 16WPBakery Shortcodes
  • 50WPEstate / WPResidence Translate Plugin
  • 51WPResidence / WPEstate CRM
  • 50WPResidence 5.0 Documentation
  • 9WPResidence Elementor Studio

Join Us On

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