Hi Jaz,
We have filters in our email function. So you can alter the message via filters.
For example
If your client is using
[#jaz_country#]
as shortcode, then you need to add the following code in your client’s functions.php file.
function geodir_alter_email_message($message) {
$search_array = array(
'[#jaz_country#]',
);
$replace_array = array(
"United States"
);
$message = str_replace( $search_array, $replace_array, $message );
return $message;
}
add_filter('geodir_sendEmail_message', 'geodir_alter_email_message', 10, 1);
That would print “United States” always.
I believe you are talking about the listing city/country.
In that case use the following code instead of the above code.
function geodir_alter_email_message($message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ) {
$post_address = "";
$post_city = "";
$post_region = "";
$post_zip = "";
$post_country = "";
if ($post_id) {
$post = geodir_get_post_info($post_id);
if($post->post_address) {
$post_address = $post->post_address;
}
if($post->post_city) {
$post_city = $post->post_city;
}
if($post->post_region) {
$post_region = $post->post_region;
}
if($post->post_zip) {
$post_zip = $post->post_zip;
}
if($post->post_country) {
$post_country = $post->post_country;
}
}
$search_array = array(
'[#jaz_address#]',
'[#jaz_city#]',
'[#jaz_region#]',
'[#jaz_zip#]',
'[#jaz_country#]',
);
$replace_array = array(
$post_address,
$post_city,
$post_region,
$post_zip,
$post_country
);
$message = str_replace( $search_array, $replace_array, $message );
return $message;
}
add_filter('geodir_sendEmail_message', 'geodir_alter_email_message', 10, 11);
Let me know how that goes.
Thanks