Skip to:
Content
Pages
Categories
Search
Top
Bottom

E-Mail notification when adding a friend


  • eriksson1337
    Participant

    @eriksson1337

    Hello,

    is there a way to send an E-Mail notification to a user that clicked on the add friend button?
    For example an E-Mail that says “You requested a friendship with user x”.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

  • Renato Alves
    Participant

    @espellcaste

    This is already the default behavior. Here is the code that fires a email when someone request to add someone as a friend: https://github.com/buddypress/BuddyPress/blob/d44e81fd40e4e9e48fc599836d311cf2752f9f34/src/bp-friends/bp-friends-functions.php#L858

    I’d recommend you to confirm if something is disabling that. Maybe the emails are not set up correctly or a theme or plugin is avoiding that to happen. Could be anything.

    This needs more investigation.


    eriksson1337
    Participant

    @eriksson1337

    Thanks for your reply.

    As far as i know, the

    function friends_notification_new_request( $friendship_id, $initiator_id, $friend_id )

    sends a notification to the person who got a friendship request.

    I would like to send an E-Mail to the user who made a request.

    For example user 1 requests a friendship with user 2. User 1 gets an E-Mail “You requested a friendship with user 2”.

    Is that possible?


    Renato Alves
    Participant

    @espellcaste

    Oh, I see! You can use the same hook and create your own email doing what you just wrote.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar