This guide will show you how to adjust the content of the emails sent when using the mail share option for MyListing Single Listings.
- Browse to the following directory structure within the parent theme: /wp-content/themes/my-listing/includes/extensions/sharer/
- Copy the sharer.php file to your local workstation and edit it with a text editor application.
- Replace the contents in the ‘Before’ snippet with those of the ‘After” snippet.
- Adjust the lines below to match your desired text.
rawurlencode( 'I Would Like to Share a Listing From '.get_bloginfo('name') ),
'Hi. I thought you might be interested in the following Listing.' . "%0D%0A%0D%0A".Before
public function mail( $options ) {
if ( empty( $options['title'] ) || empty( $options['permalink'] ) ) {
return;
}
$url = sprintf(
'mailto:?subject=%s&body=%s',
rawurlencode( '['.get_bloginfo('name').'] ' . $options['title'] ),
rawurlencode( $options['permalink'] )
);
return $this->get_link_template( [
'title' => _x( 'Mail', 'Share dialog', 'my-listing' ),
'permalink' => $url,
'icon' => 'fa fa-envelope-o',
'color' => '#e74c3c',
'popup' => false,
] );
}After
public function mail( $options ) {
if ( empty( $options['title'] ) || empty( $options['permalink'] ) ) {
return;
}
$url = sprintf(
'mailto:?subject=%s&body=%s',
rawurlencode( 'I Would Like to Share a Listing From '.get_bloginfo('name') ),
'Hi. You might be interested in the following Listing.' . "%0D%0A%0D%0A".
$options['title'].'%0D%0A'.
$options['permalink']
);
return $this->get_link_template( [
'title' => _x( 'Mail', 'Share dialog', 'my-listing' ),
'permalink' => $url,
'icon' => 'fa fa-envelope-o',
'color' => '#e74c3c',
'popup' => false,
] );
}- Browse to the following directory structure within the child theme: /wp-content/themes/my-listing-child/includes/extensions/sharer/
- Copy the sharer.php file from your local workstation and place it in the folder from the previous step.
- Test
Once you complete the above steps, you should have an email with the following content.
Subject:
I Would Like to Share a Listing From <Website Name>
Body:
Hi. I thought you might be interested in the following Listing.
<Listing Title>
<Listing URL>
