Hi, thanks for purchasing the bundle.
Currently, WPAdverts does not send emails on its own, if you would like it to send messages you can use a plugin like Better Notifications for WordPress https://ww.wp.xz.cn/plugins/bnfw/ and configure it to send an email when Advert changes status from “pending” to “publish” or when the Ad status will change to “expired”.
You can also use post status transitions for this, https://codex.ww.wp.xz.cn/Post_Status_Transitions but how to set up the transitions depends on how you have WPAdverts setup, that is if you are using payments (or WooCommerce Payment)? or are you keeping the Ads in moderation?
Hello, can You help me with setting on BNFW for WPAdvert? I would like to get an email when someone try to post some Ad. How can I set this in WP? Thanks
Hi, you can use this code snippet https://github.com/simpliko/wpadverts-snippets/blob/master/bnfw-trigger/bnfw-trigger.php, it will make BNFW plugin send a message when Advert is published or saved as pending.
Once you do that you should be able to create a new BNFW notification for “New Post Published” or “New Post Pending” (if you have moderation enabled).
Hi Greg,
I want the person who posts an ad to receive a notification once its published, how do i do that please.
Thanks for the awesome job
Hi, you can do this by adding the code below in your theme functions.php file
add_action( "advert_publish", "on_advert_publish" );
function on_advert_publish( $post_id ) {
$to = get_post_meta( $post_id, "adverts_email", true );
$advert = get_post( $post_id );
wp_mail( $to, "Ad Published", sprintf( "Your ad %s has been published", $advert->post_title ) );
}
Thanks Greg,
Will it send an email to users who are not registered too?
Just tested, its not sending any email Greg
Sorry, the first line should be
add_action( "publish_advert", "on_advert_publish" );
also note the email is sent when the Ad is published not posted.
thanks its working, but when moderating you have to select the author, where does this leave the ads posted by guys who are not registered.
This notification is being sent to the admin because when moderating i change the author otherwise it goes with admin name as the person who posted the ad
The line $to = get_post_meta( $post_id, "adverts_email", true ); gets an email of a person who posted the Ad (unless you have the form customized and this field removed), so the email should be sent to a person who posted the Ad, this works the same for both registered and not-registered users who posted an Advert.
Thanks Greg, you are a genius
HI Greg, Better Notifications does not offer Classified expired, for our business model, that is very important, can you help?

Hi, i am not sure, if BNFW allows adding new triggers to the form, but you can send the expiration message as explained here https://ww.wp.xz.cn/support/topic/expired-ads-3/