Hi, I don’t like that users have to sign in to send a message about a listing so I have created a custom form for the listing page for users to send messages to the vendor. The issue is I need the email to go to the vendor and not the site admin [_site_admin_email]. I am using Contact Form 7. Does anyone know the email shortcode I could slot into the ‘To’ field so this happens?
I am using the following PHP script to display the contact form on the listing page so another option would be to edit the code to change the script to implement my requirement above, but I am not good with PHP. Any help would be much appreciated:
add_filter(
'hivepress/v1/templates/listing_view_page/blocks',
function( $blocks, $template ) {
$listing = $template->get_context( 'listing' );
if ( $listing ) {
$blocks = hivepress()->helper->merge_trees(
[ 'blocks' => $blocks ],
[
'blocks' => [
'listing_actions_primary' => [
'blocks' => [
'vendor_email_link' => [
'type' => 'content',
'content' => do_shortcode( '[contact-form-7 id="46bfaf7" title="Reply To Listing"]' ),
'_order' => 5,
],
],
],
],
]
)['blocks'];
}
return $blocks;
},
1000,
2
);
Thanks