I only have one business listing in the website that has the GeoCraft theme at http://inghamnorthqld.com.au/ but I started to receive 100s of emails saying "Your listing reactivation notice", from "Site Admin". The details of the email are:- -------------------------------------------------------------------------------- Dear INQadmin, Your listing is expired. We inform you, if you are interested to reactivate your listing, Login in our website and reactivate it. -------------------------------------------------------------------------------- Your listing Title: Townsville -------------------------------------------------------------------------------- Website: SHIFT Ingham North QLD Website URL: http://inghamnorthqld.com.au-------...--------------------------------------------- Why am I receiving so many copies of this email? How can I edit what is said in this email? Look forward to a reply. Regards Tracy
The email send when the listing comes to be expired. You can edit the text by opening listing_expiry.php file. It is located in geocrafttheme=> library => controls => listing_expiry.php and then cursor your mouse to line number 39 to 46. We'll make it more customizable by visually in future.
What do I change post_author to in order to send an expiry notification to the listing email address rather than the author's email? I can't find a class for the listing. if ($expire == true && empty($is_expired)) { $post_author = $listing->post_author; $site_name = get_option('blogname'); $email = get_option('admin_email'); $website_link = get_option('siteurl'); $listing_title = $listing->post_title; $lisgint_guid = $listing->guid; $login_url = site_url("/wp-login.php?action=login"); $listing_user_name = get_the_author_meta('user_login', $post_author); $message .= "--------------------------------------------------------------------------------\r"; $message .= sprintf(__("Dear %s,", 'geocraft') . " \r", $listing_user_name); $message .= __("Your listing is expired. We inform you that, if you are interested to reactivate your listing,", 'geocraft') . " \r"; $message .= __("Login in our website and reactivate it.", 'geocraft') . " \r"; $message .= "--------------------------------------------------------------------------------\r"; $message .= sprintf(__("Listing Title: %s", 'geocraft') . " \r", $listing_title); $message .= "Login On: $login_url \r"; $message .= "--------------------------------------------------------------------------------\r"; $message .= sprintf(__("Website: %s", 'geocraft'), $site_name . "\r"); $message .= sprintf(__("Website URL: %s", 'geocraft'), $website_link . "\r"); $message .= "--------------------------------------------------------------------------------\r"; //$message1 .= "--------------------------------------------------------------------------------\r"; $message1 .= __("Dear Admin,", 'geocraft') . " \r\r"; $message1 .= __("A listing from one of your users got expired and a notification email has been sent to the user.", 'geocraft') . " \r\r"; $message1 .= __("Expired Listing Details are as follows:", 'geocraft') . " \r"; $message1 .= "--------------------------------------------------------------------------------\r"; $message1 .= sprintf(__("User Name: %s", 'geocraft') . " \r", $listing_user_name); $message1 .= sprintf(__("Listing Title: %s", 'geocraft') . " \r", $listing_title); $message1 .= "--------------------------------------------------------------------------------\r\r"; $message1 .= __("Kindly, Login to your site for more information:", 'geocraft') . " \r\r"; $message1 .= sprintf(__("Login On: %s", 'geocraft'), $login_url . "\r"); $message1 .= sprintf(__("Website: %s", 'geocraft'), $site_name . "\r"); $message1 .= "Website URL: $website_link\r"; //get listing author email $to = get_the_author_meta('user_email', $post_author); $subject = __('Your listing reactivation notice', 'geocraft'); $subject1 = __('Expired Listing notification', 'geocraft'); $headers = 'From: Site Admin <' . $email . '>' . "\r\n" . 'Reply-To: ' . $email; if (empty($expired_listing)) { $array = array(); update_option('gc_expired_listing', $array); } $expired_listing = (array) get_option('gc_expired_listing'); array_push($expired_listing, $listing->ID); update_option('gc_expired_listing', $expired_listing); //email to user wp_mail($to, $subject, $message, $headers); //email to admin wp_mail($email, $subject1, $message1); } }
I'm thinking I want to add get_post_meta($post->ID, $field, true) Is this correct? $vendorEmail = get_post_meta($post->ID, $field, true); wp_mail($vendorEmail, $subject, $message, $headers);
Here is what is posted on the post page: $listing_type = get_post_meta($post->ID, 'geocraft_listing_type', true); $custom_meta = get_custom_field(); foreach ($custom_meta as $meta): $field = $meta['name']; $title = $meta['title']; if ($meta['show_on_listing'] == 1) { if ($listing_type == 'free' && $meta['show_free'] == 'true') { if ($meta['type'] != 'image_uploader' && !in_array($field, $social_exclude) ) { if (get_post_meta($post->ID, $field, true)) { ?> <tr> <td class="label default"><?php echo $title; ?> </td> <td><?php if ($field == 'geocraft_website') { echo '<a target="new" href="' . get_post_meta($post->ID, $field, true) . '">' . get_post_meta($post->ID, $field, true) . '</a>'; } elseif ($field == 'geocraft_phone') { echo '<a href=tel:' . str_replace(' ', '', get_post_meta($post->ID, $field, true)) . '>' . str_replace(' ', '', get_post_meta($post->ID, $field, true)) . '</a>'; } elseif ($field == 'geocraft_meta_email') { echo '<a href=mailto:' . get_post_meta($post->ID, $field, true) . '?Subject=subject here&Body=bodytext>' . get_post_meta($post->ID, $field, true) . '</a>'; } elseif ($meta['type'] == 'multicheckbox') { echo implode(', ', get_post_meta($post->ID, $field, true)); } else { echo get_post_meta($post->ID, $field, true); } ?>