How to make a feedback system?

I’m new in the DevForum so maybe I’m in the wrong category.

  1. What do you want to achieve? Create a feedback system, where the players can write what they liked or disliked in the game then I’ll receive what they said.

  2. What is the issue? I don’t know how to do.

  3. What solutions have you tried so far? I tried free models.

Thanks for helping ! :heart:

Edit (14 days after the topic’s creation lol): I don’t want a feedback system that send a message to a discord server because I don’t have discord. E-Mail system is good as said @domboss37 but as I’m a novice developer I don’t know how to do what he said…

4 Likes

follow this tutorial it will be helpful to you:

4 Likes

search for other forums or enable https requests in game settings and then test in game

2 Likes

Make the gui with a text box and stuff, then when the player submits a response use an API to send an email to yourself with all the data

3 Likes

I don’t have discord so I can’t…

1 Like

I’ll try this, hope it will work!

1 Like

You can use datastore , in which there is a list of all feedbacks and for you to read them you can add a personal gui for yourself in which it displays all the feedback.

3 Likes

Ok, thanks for helping me! :slight_smile: Hope you have a good day !

2 Likes

Btw I know you’re a very good dev but I’m a noob dev so I don’t really know how to do that :sweat_smile:. Maybe you can explain! Thanks! :slightly_smiling_face:

@EliottENAnnoucement Sure thing, i’m very sorry I didn’t see this earlier!

So you wanna find an api,
I’m using the one found here (sign up and use the free “subscription”): SendGrid API Documentation (sendgrid) | RapidAPI

Then back on roblox studio’s we’re going to make a remote event (in ReplicatedStorage) called SendFeedback, and a Script inside of ServerScriptService, time for the code break down:

First things first we need to get the HttpService so we can make API requests:

local HttpService = game:GetService("HttpService") -- Get the http service so we can make calls to the api

Next we wanna get replicated storage and grab the remote event:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SendFeedbackEvent = ReplicatedStorage.SendFeedback

Now into the variables for our API, we first need the API URL and the Headers, both of these will be found on you Rapid Api thing (where I sent you the API)

local API_URL = "https://rapidprod-sendgrid-v1.p.rapidapi.com/mail/send"

local Headers = {
	['X-RapidAPI-Key'] = "Your Key Here",
	['X-RapidAPI-Host'] = "Your Host Here"
}

Now we initialize a function, take in a parameter for the Title of the Email and for the actual feedback, then we’ll initialize our payloads:

local function SendFeedback(Player, Title, Feedback)
	local payload = {
		["personalizations"] = {
			{
				["to"] = {{["email"] = "yourrecievingemail@here.com"}}, -- Add the email to recieve the emails 
				["subject"] = Title -- The Title of the email the user sent (using the parameter of the remote event)
			}
		},
		["from"] = {["email"] = "yoursendingemail@here.com"}, -- Add your sending email here
		["content"] = {
			{
				["type"] = "text/plain",
				["value"] = Feedback -- This is the feedback the user gave (taking it from the remote event parameter)
			}
		}
	}

The payloads are our data, this is all the stuff we are sending, but we can’t use that data yet, we first need to encode it in a JSON format using JSONEncode:

local data = HttpService:JSONEncode(payload)

Finally we want to Send our API request and exit the function:

HttpService:PostAsync(API_URL, data, Enum.HttpContentType.ApplicationJson, false, Headers)
end

Last thing to do for this is connect our remote event to that function:

SendFeedbackEvent.OnServerEvent:Connect(SendFeedback)

Full code for that:

local HttpService = game:GetService("HttpService") -- Get the http service so we can make calls to the api
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SendFeedbackEvent = ReplicatedStorage.SendFeedback

local API_URL = "https://rapidprod-sendgrid-v1.p.rapidapi.com/mail/send"

local Headers = {
	['X-RapidAPI-Key'] = "Your Key Here", -- Replace
	['X-RapidAPI-Host'] = "Your Host Here" -- Replace
}

local function SendFeedback(Player, Title, Feedback)
	local payload = {
		["personalizations"] = {
			{
				["to"] = {{["email"] = "yourrecievingemail@here.com"}}, -- Add the email to recieve the emails 
				["subject"] = Title -- The Title of the email the user sent (using the parameter of the remote event)
			}
		},
		["from"] = {["email"] = "yoursendingemail@here.com"}, -- Add your sending email here
		["content"] = {
			{
				["type"] = "text/plain",
				["value"] = Feedback -- This is the feedback the user gave (taking it from the remote event parameter)
			}
		}
	}
    local data = HttpService:JSONEncode(payload)
    HttpService:PostAsync(API_URL, data, Enum.HttpContentType.ApplicationJson, false, Headers)
end

SendFeedbackEvent.OnServerEvent:Connect(SendFeedback)

Alright, now onto the UI, for this i’m doing a simple UI but you can do what you want. Here’s what you need though, 2 text boxes (one for the email title, one for the feedback) and a send button.

In the send button you will have a local script that looks something like this (just change the paths to the labels and that stuff)

local RS = game:GetService('ReplicatedStorage')
local Event = RS.SendFeedback
local FeedbackFrame = script.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()
	Event:FireServer(FeedbackFrame.Title.Text, FeedbackFrame.Feedback.Text)
end)

And BOOOM! Working feedback email system.

MAKE SURE TO ENABLE ACESS TO HTTP SERVICES IN SETTINGS

Some Recomendations:

  1. Add a delay, only let a user send 1 email like every few hours or so (so you don’t spam and they don’t use the full rate)

That’s all really, hope this helped!

3 Likes

I think it’ll help a lot! But wow you wrote this entire giant post for me?! Thanks!

1 Like

That’s good to hear, have you tried it yet?

Ofc, np

1 Like

No, I work on lot of things, I’m very busy.

I can’t sign up, it write page not found… Do you know another API that should work?

It should let you sign up, before you subscribe, you need to click the button on the very top corner that says sign up, this should be next to a log in button.

Well there are definitely more API’s for this, idk if I’d be able to find one that’s free, also the steps would be slightly different

I know but when I click it, it print “Page not found”.

Can you send a video of this happening, it works fine for me when I click sign up

Ok, I’ll do tomorrow. Have a good day!