Home › Forums › Front End PM PRO › SMS notifications for private messages
- This topic has 4 replies, 2 voices, and was last updated 6 years, 8 months ago by Audric Smith.
- AuthorPosts
- April 23, 2019 at 5:22 am #23684Audric SmithParticipant
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
April 23, 2019 at 9:04 am #23698Shamim HasanKeymasterYou 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 ); }April 24, 2019 at 5:53 am #23736Audric SmithParticipantThank 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
April 24, 2019 at 2:07 pm #23754Shamim HasanKeymasterWhich 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.
April 25, 2019 at 2:30 am #23790Audric SmithParticipantIt would be great if you could do this custom work for me. Please contact me via my email.
Thanks
- AuthorPosts
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.