I'm trying to call an external PHP script from an Expression Engine form response template that sends emails using Mandrill API. The script I have works on regular PHP, I have tested it, but there is some sort of issue with the path for the includes. I've double checked the absolute paths and they are correct. Anyone see an issue?
require_once '/www/host/public_html/mandrill-api-php/Mandrill.php';
require_once '/www/host/public_html/mandrill-api-php/madrillSend.php';
$msg = "TEST MESSAGE";
$location = "{location}";
$ebrochure = "{ebrochure}";
$output = SendMandrill($location, $msg, $ebrochure);
echo $output;
=================================================
function SendMandrill($location, $msg, $ebrochure) {
$mandrill = new Mandrill('xxx');
$message = array(
'html' => null,
'text' => $msg,
'subject' => $subj,
'from_email' => '[email protected]',
'from_name' => 'Leads Account',
'to' => array('email' => '[email protected]', 'type' => 'to),
'headers' => array('Reply-To' => '[email protected]'),
'important' => false,
);
$async = false;
$ip_pool = 'Main Pool';
$send_at = '';
$result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
return $result;
}
==================================================
Warning: require_once(/www/host/public_html/mandrill-api-php/madrillSend.php) [function.require-once]: failed to open stream: No such file or directory in /www/host/public_html/system/core/core.functions.php(634) : eval()'d code on line 15
Fatal error: require_once() [function.require]: Failed opening required '/www/host/public_html/mandrill-api-php/madrillSend.php' (include_path='.:/usr/share/pear:/usr/share/phpz ) in /www/host/public_html/system/core/core.functions.php(634) : eval()'d code on line 15