Log in

View Full Version : Sending automatic PMs from SYSTEM


KatFennec
06-04-2017, 03:05 AM
Does anyone know how to automatically send PMs to users from SYSTEM, or have any pointers as to how I would do so?

Dinocanid
06-04-2017, 09:36 AM
This is how I send automatic PMs when users first register.
$pm = new PrivateMessage(); // Send them a message
$pm->setsender('SYSTEM');
$pm->setrecipient(htmlentities(addslashes(trim($mysidia->input->post("username")))));
$pm->setmessage("Title", "Your Message");
$pm->post();
You'll most likely have to replace $mysidia->input->post("username") with $mysidia->user->username depending on how you plan to use it.