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;