Can I restrict guests from sending us feedback so that only registered users will be able to do so?
Yes, you can achieve this in many ways.
The easiest way (and considering you are using the Rainlab.User plugin), is use a conditional tag testing if the user is present.
something like this:
{% if user %}
{% component 'feedback' %}
{% else %}
<p>Sorry, only registered users can send messages</p>
{% endif %}
Last updated
Hi thanks for your answer. I'd like to ask something else:
Can the user still "inject" the feedback if they know the link and call it through an http request? Is the feedback automatically associated with the registered user? If not how do I achieve this?
Yes, if the user execute a post with the correct data, it will submit successfully.
No, feedback is not associated with the registered user.
For all the answers, it can be customised.
The easiest way to associate user data to a message is customise the component template.
You will need basic html knowledge.
First "expand" the component template https://octobercms.com/docs/cms/components#customizing-default-markup
When it is done, just add the {{ user.email }}
and {{ user.name }}
to the appropriate input tags
1-6 of 6