• Resolved kintango

    (@kintango)


    Hi! My advert_add form is on moderate=1 and i want to send or display an automatic message when users post an Ad. How can i do that ?

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    to send an email when Advert is saved in the database as pending you can use the advert_tmp_to_pending post status transition like this

    
    add_action( "advert_tmp_to_pending", "on_advert_pending", 10, 1 );
    function on_advert_pending( $post ) {
      $to = get_post_meta( $post->ID, "adverts_email", true );
      $subject = "New Ad has been posted.";
      $msg = sprintf( "You can view your Ad here %s", get_permalink( $post->ID ) );
      wp_mail( $to, $subject, $msg );
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Moderated adverts’ is closed to new replies.