Jump to content

Automatically send a private message on button click


Thrillerek

Recommended Posts

/* Create conversation */
$conversation = \IPS\core\Messenger\Conversation::createItem( $this->sender, $this->sender->ip_address, \IPS\DateTime::ts( time() ) );
$conversation->save();
$conversation->authorize( $recipient );

/* Add message */
$message = \IPS\core\Messenger\Message::create( $conversation, $this->content, TRUE, NULL, NULL, $this->sender );
$conversation->first_msg_id = $message->id;
$conversation->save();
					
$notification = new \IPS\Notification( \IPS\Application::load('core'), 'private_message_added', $conversation, array( $conversation ) );
$notification->send();					

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...