Integrating PHP-API-Request-Code within Wordpress (Elementor)

Hello everyone,

I am currently trying to integrate a PHP-API-Request (look screenshot) on a Wordpress site. My goal is to send the name and email to the HubSpot-Contact-Page, by taking the inputs from the user within a form. But because Wordpress does not accept raw <?php ?> code, I am struggling to integrate that request. This is why the PHP-Code currently within a <script>-tag and need a solution for that. Somehow it worked once like that, but not anymore and I don’t know why. I would appreciate any help, thank you!

Hi, @DWI :waving_hand: Thanks for your question. I’d like to invite some of our community members to the conversation — hey @tominal @danhammari @MatthiasWeber do you have any suggestions for @DWI?

Based on some quick research, it sounds like you’ll need to do this by creating a custom WordPress plugin or adding code to your theme’s functions.php file. And I am not a PHP user by any means.

Best,

Jaycee

Hi @DWI. One idea from my side: use the wordpress plugin from hubspot. It’s pure magic when it comes to forms ;-). You can use forms created in hubspot or if you do your own form in wordpress / elementor / … the plugin catches the form submit and sends it hubspot. One pro tipp: if you use the hubspot field names in your form, it matches automaticly your data / content.

Or did you tried the plugin already?

Best

Matt