SMS notifications for private messages


Home Forums Front End PM PRO SMS notifications for private messages

This topic is: Not Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23684
    Audric Smith
    Participant

    Hi,

    I’m trying to integrate SMS notifications for private messages and the only piece of the puzzle that I need is the PHP code for the recipient.

    So, for instance, user A sends pm to user B and user B receives SMS notification that there’s a new pm message.

    The problem is that in your code there’s no code for recipient, only participants are listed.

    So far I tested everything with class-fep-emails, function send email and SMS sending is working, just need a code for a pm recipient user id > custom field “mobile”

    $mobile= ‘mobile number’;
    $msg =

    wp_sms_send( $mobile, $msg );

    I would really appreciate if you could help me out with this.

    Thanks

    Nick

    #23698
    Shamim Hasan
    Keymaster

    You can use like following

    $participants = fep_get_participants( $mgs_id );
    foreach ( $participants as $participant ) {
        if ( $participant == fep_get_message_field( 'mgs_author', $mgs_id ) ) {
        	continue;
        }
        $mobile = get_user_meta( $participant, 'mobile', true );
        $msg = 'What you want to send';
    
        wp_sms_send( $mobile, $msg );
    }
    
    #23736
    Audric Smith
    Participant

    Thank you for the example, but it’s not working, I tried everything including changing the keys etc..

    I am testing with send_email function in class-fep-emails.php and the mobile number is users custom field (Advanced Custom Fields plugin).

    function send_email( $postid, $post ){
    $participants = fep_get_participants( $postid );
    $participants = apply_filters( ‘fep_filter_send_email_participants’, $participants, $postid );

    if ( $participants && is_array( $participants ) ){

    PM Recipient > Recipient user id > mobile custom field

    Any help would be highly appreciated.

    Thanks

    Nick

    #23754
    Shamim Hasan
    Keymaster

    Which version of this plugin you are using?
    What is the key of your user’s mobile number? Where and how did you used code which i provided? Please give me full changes what you have done so that i can correct you is possible.

    This plugin is highly customizable. So i suggest not to edit this plugin code. Use hooks instead.

    #23790
    Audric Smith
    Participant

    It would be great if you could do this custom work for me. Please contact me via my email.

    Thanks

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

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.