Is there any way to see which listing has been renewed by the vendors? I have activated search alerts for everything without any filters, so I am receiving information that a listing was reactivated, but I don’t know which one.
Hi,
Unfortunately, there is no way to see which listings are there, only a link to the search results page in the email will be displayed, and there you can simply view new listings.
I hope this is helpful to you.
Thank you for the prompt reply.
With the link, I can see all the listings. Vendors have a yearly subscription, but after 30 days, when a listing expires, they can reactivate it. I need a way to identify which listings were reactivated.
Hi,
Unfortunately, this is not possible because Search Alerts does not differ between renewed listings and new ones, and will send emails if there is at least one new listing.
As a workaround, we can provide a PHP snippet that will send an email to the administrator if the listing has been renewed.
Hi Andrii,
Please provide the snippet.
Please try this one:
add_action(
'hivepress/v1/models/listing/update_status',
function( $listing_id, $new_status, $old_status, $listing ) {
if ( 'draft' === $old_status && 'publish' === $new_status && strtotime( $listing->get_created_date() ) === time() ) {
wp_mail( get_option( 'admin_email' ), 'Listing Renewed', get_permalink( $listing_id ) );
}
},
10,
4
);
It sends the listing URL to the site admin when the listing is renewed.
Thank you, will try it.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.