Omri Amos Posted October 17, 2016 Share Posted October 17, 2016 Hi, I'm using REST API in order to allow users to post topics/posts to the forum from my website. The topics/posts are created successfully, they are assigned to the users, and everything works great - beside one issue: after sending the topic/post, the user does not get subscribed to the topic (even if the user's default settings is to automatically subscribe to topics they reply in). I wish that the REST API would automatically subscribe the user to the topic after posting the reply / creating a topic. If it's not possible with the REST API (which seems to be the case) then I would love to hear any ideas about a workaround. I don't mind even running a SQL query directly (so after the REST API call, I will perform the query to subscribe the user_id to topic_id), if that will be the only solution, but I was unable to easily find out where in the database this is actually saved... Thanks Link to comment Share on other sites More sharing options...
TSP Posted October 17, 2016 Share Posted October 17, 2016 Look inside applications/core/modules/front/system/notifications.php and/or system/Content/Item.php, search for core_follow inside the files. Weirdly enough they don't have a method for this, so they actually use raw database queries in both those places. Link to comment Share on other sites More sharing options...
Omri Amos Posted October 17, 2016 Author Share Posted October 17, 2016 The code looks awfully complicated with stuff like "application", "followArea", etc'... but it actually pointed me to the "core_follow" table (how did I miss that? ), which looks much easier to understand. Thanks again Link to comment Share on other sites More sharing options...
Omri Amos Posted October 17, 2016 Author Share Posted October 17, 2016 OK, I was able to accomplish that successfully. Thanks Link to comment Share on other sites More sharing options...
Omri Amos Posted October 17, 2016 Author Share Posted October 17, 2016 UPDATE: I was able to manually subscribe the user, but then I noticed another issue - when adding a post using the REST API, it does not SEND A NOTIFICATION to subscribed users..... So now I also need to find a way to "send" the notification about this post to the subscribed users.... help? UPDATE / EDIT: My bad it seems to be working fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.