Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Thrillerek Posted August 14, 2015 Posted August 14, 2015 Hey. I'm kind of new to 4.0.x and currently don't have the time to search for it in the code. So I would like to ask you guys for help. How can I make this? On the previous versions it was something like this: https://www.invisionpower.com/support/guides/_/advanced-and-developers/api-methods/sending-private-messages-r223Thanks a lot!
Daniel F Posted August 16, 2015 Posted August 16, 2015 /* 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();
Kevin Carwile Posted August 16, 2015 Posted August 16, 2015 Don't you have to do a $message->save() first before you try to assign that message id?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.