Add a functioning contact form in the game UI

Is there a way (feasible by a beginner) to insert a pop-up contact form at the end of the experiece?

Hi @J.Gic and welcome,

For contact forms I would go with using an HTML overlay. In there you can use any kind of form input elements and regular HTML/JS libraries for your forms.

Check the following examples to get started with PlayCanvas and HTML:

https://developer.playcanvas.com/en/tutorials/?tags=html

1 Like

Thanks Leonidas,
my question is if there is a way to integrate php code in playcanvas or another way to send to my and customer’s email address a message containing some parameters. I am doing a car configurator and I need to send to the customer and the company salesman a configuration report.

Hi @J.Gic,

So PlayCanvas is a regular HTML/JS web application. PHP runs on a web server and can respond to Rest API calls.

To your question yes, much like from a regular webpage, you can call your PHP end points from PlayCanvas (Javascript).

You can do that in a number of ways: using plain Javascript calls (XHR or the newer Fetch API), using the PlayCanvas pc.Http class or any other Javascript framework of your choice.

2 Likes