Hi, I really want to make messages system in my site with help module - Toolset’s Communication System.
I did all steps from this guide https://toolset.com/learn/how-to-create-a-messaging-system-with-toolset/ and lost understanding what next. How can users send messages to each other?
I will try to decribe what I want to do.
My site hidden link
Registration page - hidden link
When a user register on the site his member page is hidden link
That how it looks like now - hidden link
I need to add button "support" at this place - hidden link
And when user have clicked on it he will see modal window with send message form to admin or maybe he will be got redirect to page with send message form to admin.
And I (in admin role) should have posibility to send messages for any user.
How can I do that functionality?
Pleace help, I can provide access to my website.
Hello,
Since there are lots of steps in that document, and I don't have access to your website admin side, I am not sure which step is missing in your website, so I have enabled the private message box, in case you need I login your to your website to check the settings.
And since you just need to send the message to admin, and admin can reply the message, so it does not need those complicated custom codes as that document, you just need a custom hierarchical post type(just like the WordPress built-in page).
More help:
https://codex.wordpress.org/Function_Reference/register_post_type#hierarchical
Please let me know which one do you prefer:
1) As the document you mentioned above:
https://toolset.com/learn/how-to-create-a-messaging-system-with-toolset/
2) With a hierarchical post type
Thanks for the details, I can login your website.
Here are what I found:
1) The URL you mentioned above:
hidden link
It is not WordPress author archive page, but a normal wordpress page with a user view, and the shortcode [get_author_id_in_archive] works only in author archive page, so you will need to change the Form's code manually.
I have done below modifications in your website:
1) Edit the post form "New message":
hidden link
in section "Form Editor", replace shortcode [get_author_id_in_archive] with [wpv-current-user info='id']
So it will use the value of current user's ID of from user view "Личный кабинет" as send to user's ID.
2) Edit user view "Личный кабинет":
hidden link
in section "Loop item in Личный кабинет", at the bottom, add the form shortcode:
Send message to this user:
[cred_form form="new-message"]
You can test it in front-end:
hidden link
At the page bottom, submit the new message form, you will be able to see the messages in below pages:
hidden link
hidden link
For "modal window" issue, since you are using Bootstrap 3 in your website, I suggest you try to follow Bootstrap document to setup the modal, and display "new message" form shortcode [cred_form form="new-message"].
More help:
hidden link
Thanks for your help, but i still do not understand.
Ok, yes when I logged in like admin I see the form on page /member/ - hidden link
But how can I choose users who I want to send message? Right now if I fill this form who get message? It looks like I sent message myself - hidden link
And the second moment. If I logged in like a simple user (not admin) I do not even see the form, so how can I send a message to the admin and start a conversation?- hidden link
Q1) But how can I choose users who I want to send message?
There isn't such kind of built-in feature within new message form, it is using custom shortcode [get_author_id_in_archive] to populate the send-to field as user's ID, that shortcode work in your case.
That shortcode [get_author_id_in_archive] can only get user's ID in WordPress author archive page, but in your case it is not WordPress author archive page, it is a user view, so that shortcode won't work.
Q2) If I logged in like a simple user (not admin) I do not even see the form
Please try these:
Dashboard-> Toolset-> Access control-> Toolset Forms
in section "Post Forms Frontend Access", in column "Create Custom Post with the Form "New message"", enable options for those specific users, in your case, it should be user role "Вэбкам Модель", save and test again.
See our document:
https://toolset.com/documentation/user-guides/access-control/access-control-for-cred-forms/
There isn't such kind of built-in feature within new message form, it is using custom shortcode [get_author_id_in_archive] to populate the send-to field as user's ID, that shortcode work in your case.
That shortcode [get_author_id_in_archive] can only get user's ID in WordPress author archive page, but in your case it is not WordPress author archive page, it is a user view, so that shortcode won't work..
----------------
Ok, I no need to use [get_author_id_in_archive] but I need to use [wpv-current-user info='id']. Is it correct?
But this does not bring me closer to solving the problem. I still do not understand what I need to do next.
There is user "liluhot" (hidden link) at the bottom of the page there is message form - hidden link
If user "liluhot" will fill and send this from the message will not be send to admin. This message will be send from Liluhot to Liluhot but not from Liluhot to Admin. Do you understand what I mean?
And I totally don't understand how can I influence which user will receive the message? How do I use this shortcode [wpv-current-user info = 'id'] where to paste it? Or what do I need to do?
I think I began to understand the logic of this module. The top two posts are not relevant.
Right now my main problem is that default users pages do not work.
For example, I have two users on my site: admin and liluhot - hidden link
So, they should have default own users pages:
hidden link
hidden link - hidden link
But I can not enter on them, I am getting redirect to the main page. I do not see author archive page. And I don't understand why.
The author archive page is a built-in feature of WordPress core, for example you can try these:
Dashboard-> Users
click link "View" of each user, you should be able to see the URLs are below:
hidden link
hidden link
But those URLs do not work in your website, it is abnormal, there should be some other compatibility issue in your website, please try to deactivate all other plugins, and switch to wordpress default theme 2020, and test again.
Yes, thanks, I fixed it. At this moment I can use the user's archives pages, it was a problem with yoast seo settings.
But still, I have a couple of questions/problems.
Step by step:
1) User Liluhot sent a message to the admin. I checked my inbox and saw a new message, but I do not see who is sender - hidden link Which user sent me the letter? And Liluhot doesn't see who is the receiver - hidden link
2) I (in admin role) opened the message from Liluhot and still don't see who sent me the message - hidden link
3) And one more problem when I am opening message. The problem with CSS styles. CSS class called "single-message" for some reason was added inside tag "body" and crashed my front-end - hidden link
4) Most important. Liluhot and Admin had a little conversation - hidden link and I expected to see one dialog in "inbox" and one dialog in "outbox" because it was one conversation between two users (one dialog). But here is what I saw: Liluhot (inbox - hidden link ; outbox - hidden link ), Admin (inbox - hidden link ; outbox - hidden link ). It seems like we started three different dialogs.
After every reply is created a new dialog in the inbox/outbox . That shouldn't work like that right? Because it becomes unreadable...
Please check the URLs I mentioned above:
hidden link
hidden link
They are still being redirected to the home page:
Where and how can I submit the form "new message"?
And can you provide the credentials for user "Liluhot"? In order to debug this issue, I need to submit the "new message" form as that user.
Thanks
> They are still being redirected to the home page
No, they are not. I have checked many times. At this moments pages above are working correct and don't makes redirect to the home page.
hidden link
hidden link
Please check again. They should load fine and they contains form"New Message".
> And can you provide the credentials for user "Liluhot"? In order to debug this issue, I need to submit the "new message" form as that user.
Yes
Login: liluhot
Password: password is the same as administrator (https://toolset.com/forums/topic/i-do-not-understand-how-toolsets-communication-system-works/#post-1535113 check please my private message from March 2, 2020 at 9:04 am)
It seems that you have only tested with user "Liluhot", if you login your website as user "admin", you should be able to see the same problem: They are still being redirected to the home page.
Now, I can login as user "Liluhot", please check these:
1) In post view "Messages received"
section "Редактор цикла", it is using below shortcodes:
<div class="message-author">
[wpv-user field='user_firstname' id="[types field='message-from'][/types]"] [wpv-user field='user_lastname' id="[types field='message-from'][/types]"]
</div>
Above shortcode will output the author's first name and last name.
2) So you will need to edit the user "Liluhot"
hidden link
Setup his "First name" and "Last name"
Please check if it is fixed.
>It seems that you have only tested with user "Liluhot", if you login your website as user "admin", you should be able to see the same problem: They are still being redirected to the home page.
No! I am not getting redirection to the front page any more, please watch this short video - hidden link
And ok, thanks I understod why I did not see who is serder, and who is reciver.
But what about another problems 3 and 4:
-----------------
FIXED 1) User Liluhot sent a message to the admin. I checked my inbox and saw a new message, but I do not see who is sender - hidden link Which user sent me the letter? And Liluhot doesn't see who is the receiver - hidden link
FIXED 2) I (in admin role) opened the message from Liluhot and still don't see who sent me the message - hidden link
3) And one more problem when I am opening message. The problem with CSS styles. CSS class called "single-message" for some reason was added inside tag "body" and crashed my front-end - hidden link
4) Most important. Liluhot and Admin had a little conversation - hidden link and I expected to see one dialog in "inbox" and one dialog in "outbox" because it was one conversation between two users (one dialog). But here is what I saw: Liluhot (inbox - hidden link ; outbox - hidden link ), Admin (inbox - hidden link ; outbox - hidden link ). It seems like we started three different dialogs.
After every reply is created a new dialog in the inbox/outbox . That shouldn't work like that right? Because it becomes unreadable...
I assume the original questions of this thread is resolved, for the new questions please check the new thread here:
https://toolset.com/forums/topic/but-what-about-another-problems/