Home Forums Plugin Support WP User Frontend Pro Two Issues

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by  ronilagin 6 years, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #3026

    ronilagin
    Participant
    Post count: 24

    Is there a way to send an email to the admin and the user confirming the post details?

    Also, is there a way to remove a users credits once they expire? The reason I'm asking is because currently users are able to access areas that I have set to be limited to people with credits, even though their credits are expired.

    Thanks!

    #3027

    Tareq Hasan
    Keymaster
    Post count: 2831

    With the notification settings, can't you already send post details to the admin? If you want to send the notification also to the post author, it can be done.

    May be something wrong with your credits checking. It should be false if either credit becomes zero or it expires.

    #3028

    ronilagin
    Participant
    Post count: 24

    Hi Tareq,

    How is it done?

    Also, I will test the credits thing again to double check.

    Thanks,

    #3029

    Tareq Hasan
    Keymaster
    Post count: 2831

    [php]
    function wpufe_send_author_notification( $post_id, $form_id, $settings ) {
    $author_id = get_post_field( ‘post_author', $post_id );
    $author = get_user_by( ‘id', $author_id );

    $mail_body = WPUF_Frontend_Form_Post::prepare_mail_body( $settings[‘notification'][‘new_body'], $author_id, $post_id );
    wp_mail( $author->user_email, $settings[‘notification'][‘new_subject'], $mail_body );
    }

    add_action( ‘wpuf_add_post_after_insert', ‘wpufe_send_author_notification', 10, 3 );
    [/php]

    This should work.

    #3046

    ronilagin
    Participant
    Post count: 24

    Getting a white page when I put that function in functions.php – should it go somewhere else?

    #3047

    Tareq Hasan
    Keymaster
    Post count: 2831

    There was an unexpected character due to the syntaxhighlighter, try this

    function wpufe_send_author_notification( $post_id, $form_id, $settings ) {
        $author_id = get_post_field( 'post_author', $post_id );
        $author = get_user_by( 'id', $author_id );
     
        $mail_body = WPUF_Frontend_Form_Post::prepare_mail_body( $settings['notification']['new_body'], $author_id, $post_id );
        wp_mail( $author->user_email, $settings['notification']['new_subject'], $mail_body );
    }
     
    add_action( 'wpuf_add_post_after_insert', 'wpufe_send_author_notification', 10, 3 );
    
    #3048

    ronilagin
    Participant
    Post count: 24

    Thank you ๐Ÿ™‚

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Two Issues’ is closed to new replies.