Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Sending automatic PMs from SYSTEM (http://www.mysidiaadoptables.com/forum/showthread.php?t=5461)

KatFennec 06-04-2017 03:05 AM

Sending automatic PMs from SYSTEM
 
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.
PHP Code:

$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.


All times are GMT -5. The time now is 11:52 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.