I currently have a email pop up modal in my magento CMS but I need to hide the api so my script I will keep server side in PHP.
My question is how can I have a phtml that is just a script be imported into magento if that is possible.
this is my script
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.sendgrid.com/v3/marketing/contacts',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{"list_ids": [
"fsfsfsfsfsf"
],
"contacts": [
{
"email": "[email protected]",
"first_name": "jffff gih"
}
]
}',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer jhdfjhhueurheufheo',
'Content-Type: application/json'
),
));
I omitted the api key and list id key for example reasons.