• Resolved Thorsten :-)

    (@per4mance)


    Hi,

    What do you think about a plugin that works betwwen BuddyPress and Telegram for doing message passing?

    What would be if each user is able to put its Telegram username within its profile? Once a user sends a message to another user, the recipient gets a Telegram note that a message arrived within BuddyPress.

    Possible to do this?

    Regards,
    Thorsten

Viewing 15 replies - 1 through 15 (of 19 total)
  • Hi,
    This is already possible by combining this plugin with Private Notifications module of WP Telegram, if BuddyPress does not use the cc or bcc field in the email to notify the user.
    Take a look at User Notifications there in Private Notifications settings.

    Thread Starter Thorsten :-)

    (@per4mance)

    Thank you for your fast response.

    I realized a switch for activating this but I do not know how to use it. I’ve to dive into it now.

    Let me explain the flow to you:
    – User uses Telegram Login to connect the Telegram account to WordPress.
    – WP Telegram Login saves the Telegram user ID in the database.
    – BuddyPress or any other plugin sends an email to the user.
    – WP Telegram (Private Notifications) identifies the user by email.
    – Telegram user ID (saved above) is used to send that email to Telegram.

    Thread Starter Thorsten :-)

    (@per4mance)

    Ok, I’m going to do this step by step.
    In backend mode I’ve seen the user has to create a ‘Telegram Chat ID’. I’ve got it, very easy. But it seems the user is not able to put its own Chat ID in frontend mode by using BuddyPress, right?

    In backend mode I found a translation issue of ‘Bitte gib deine Telegram Chat ID ein’ in English ‘Please enter your Telegram Chat ID’. Here you used the informal German. I want to change this into formal German ‘Bitte geben Sie Ihre Telegram Chat ID ein’, but I couldn’t generate a translation template with Poedit (receive an error).

    You don’t need to enter that if a user has already logged in with Telegram.

    Thread Starter Thorsten :-)

    (@per4mance)

    Ahh…ok, but this is the issue I discussed before with you. For now I cannot use this plugin for registration because my user (parents of an elementary school) has to fill out a registration form with more fields. After this process and the activation of the account, the user should be able to enter the code by hand in its profile.

    This way has to do with the GDPR, to do everything by law.

    Is there any chance to make this field visible and editable in frontend for BuddyPress user?

    Yes, you can add the User/Chat ID field anywhere you want. Just make sure the field is saved as telegram_chat_id in user_meta.

    Thread Starter Thorsten :-)

    (@per4mance)

    Ok I did a test.

    User A (me) has entered the Chat-ID in backend mode. User B sent a comment through BuddyPress. User A (me) received this comment by Telegram-Bot (I arranged this Bot before). Same happens if a private message has been sent by User B to A.

    Question: In the case above I’m the User A and Bot-Admin in one person. Would I receive every message (comment, PM) by my Bot because I’m the admin also? If yes I would receive hundreds or maybe thousands of personal messages of users and could read along.

    Am I right? If yes, this would go against GDPR. And wouldn’t it be better just give the link where the recipient can read the message by link (you already do this) but without the content?

    I’m sorry for hard testing your plugin.

    Regards ??

    Private messages are always private. You won’t receive others’ messages.

    Thread Starter Thorsten :-)

    (@per4mance)

    Ok, thank you for the time to explain how your plugin works. I’m going to do more tests and will come back for any questions I will have ??

    Great support!!!

    Thread Starter Thorsten :-)

    (@per4mance)

    @manzoorwanijk

    I did the following: With BuddyPress I can add profile fields. These fields can be named as “Telegram Chat ID” for example. But the field itself gets a number automatically like “field_1000” for example.

    In WordPress backend the field “telegram_chat_id” already exists. I want to show this field in profile field of BuddyPress frontend, so the user is able to enter its Telegram Chat ID by hand.

    How to do this?

    You can pass the saved ID from BuddyPress to WP Telegram using this code:

    /* WP Telegram - Get User/Chat ID */
    add_filter( 'wptelegram_notify_user_chat_id', function ( $chat_id, $email ) {
    
    	$user = get_user_by( 'email', $email );
    
    	if ( $user instanceof WP_User ) {
    		// get the ID from BuddyPress field like "Telegram Chat ID" etc.
    		$value = bp_get_member_profile_data( 'field=Telegram Chat ID' );
    		if ( ! empty( $value ) ) {
    			return $value;
    		}
    	}
    
    	return $chat_id;
    }, 10, 2 );
    Thread Starter Thorsten :-)

    (@per4mance)

    @manzoorwanijk

    Thanks for your fast response, but where do I have to enter this code if I created a new field?

    I casn create a new field where I enter a name “Telegram Chat ID”, and as a second option I can enter a description for this field. After this I can determine the type of field (checkbox, date, email etc).

    And now?

    I have updated the code to demonstrate how to get the data.

    You can add that code to functions.php of your active/child theme.

    Thread Starter Thorsten :-)

    (@per4mance)

    Ok, I did that but without success, see the screenshot of the field I created. The backend still has the Chat ID but won’t show in my profile.

    https://www.screencast.com/t/br5EIeN2AhO

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Idea for a new service’ is closed to new replies.