Alert keeps sending to wrong user

Forum
Last Post
Threads / Messages

GeneticAlpha

Loving Mysidia!
Member
Joined
May 24, 2020
Messages
287
Points
18
Age
31
Location
Tennessee
Mysidian Dollar
13,377
$pm = new PrivateMessage(); // Send a message
$pm->setsender('SYSTEM');
$pm->setrecipient(htmlentities(addslashes(trim($mysidia->user->username))));
$pm->setmessage("Friend Request Accepted!", "<p>Your friend request from {$mysidia->user->nickname} been accepted.</p>");
$pm->post();

return;

So I have this code for when a user accepts a friend request, an alert tells the person who sent the request that the request was accepted. I have it all working, except the user it keeps sending the alert to is the accepter themselves, instead of to the sender who sent the request. Any idea how I can fix this? I'm wanting the alert to go to a person when their outgoing friend request was accepted.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top