// if the ad has been approved send email to ad owner only if owner is not equal to approver
// admin approving own ads or ad owner pausing and reactivating ad on his dashboard don't need to send email
if ($old_status == 'pending' && $new_status == 'publish' && $current_user->ID != $ad_author_id && $send_approved_email == 'yes') {
$subject = __('Your Ad Has Been Approved','cp');
$headers = 'From: '. sprintf(__('%s Admin', 'cp'), FarmAds) .' <'. get_option('admin_email') .'>' . "\r\n";
$message = sprintf(__('Hi %s,', 'cp'), $ad_author) . "\r\n\r\n";
$message .= sprintf(__('Your ad listing, "%s" has been approved and is now live on our site.', 'cp'), $ad_title) . "\r\n\r\n";
$message .= __('You can view your ad by clicking on the following link:', 'cp') . "\r\n";
$message .= get_permalink($post->ID) . "\r\n\r\n\r\n\r\n";
$message .= __('Share your ad with your friends on Facebook:', 'cp') . "\r\n";
$message .=
"http://www.facebook.com/sharer.php?u=get_permalink($post->ID)" . "\r\n\r\n\r\n\r\n";
$message .= __('Regards,', 'cp') . "\r\n\r\n";
$message .= sprintf(__('Your %s Team', 'cp'), FarmAds) . "\r\n";
$message .= $siteurl . "\r\n\r\n\r\n\r\n";
// ok let's send the email
wp_mail($mailto, $subject, $message, $headers);