listing_inquiry_email_payload

Filter Hook Inquiries

Filter inquiry email payload before email is sent.

Parameters

$payload

(array) associative array with email parts: to, bcc, fromEmail, fromName, subject, body

$params

(array) associative array with contextual data

You need to have a working knowledge of Hooks before you get started.

Boilerplate Code

Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.

Clickfwd\Hook\Filter::add('listing_inquiry_email_payload', function($payload, $params) 
{
  // Uncomment line below to view available data passed into hook
  // For JReviews 3.x and earlier use dd instead of fwd_dd
  // fwd_dd($payload, $params);
  
  return $payload;
});
Development & Support
Customizations are not included with support. We provide this information to make it easier for developers to extend the functionality. From time to time we may have some availability for custom work. Get in touch to see if there's an opportunity to work together.

Examples

Modify Sender Name and Email

When an inquiry is sent, the email sender name and email are populated with the information provided by the user in the inquiry form. With the code below you can change the sender email and name so recipients of inquiries cannot reply directly to the sender.

Clickfwd\Hook\Filter::add('listing_inquiry_email_payload', function($payload, $params)
{
   $listing = $params['listing'];
 
   $event = $params['event'];
 
   $extraFields = json_decode($event->get('extra_fields'),true);
 
   $payload['fromEmail'] = '[email protected]';
 
   $payload['fromName'] = 'John Smith';
 
   return $payload;
}, 10);

Source

  • /events/listeners/send_listing_inquiry_email.php