I would like to add this to the message part of the script “Thank you ‘name’ for sending your message. A Representative will be contacting you shortly confirming the details of your rental. \n\nSincerely,\n\nHightened Path RV Rentals”
I’m new to PHP and do not understand how to fit this in. I keep getting syntax errors. Here is the actual code:
function confirmSend($option_arr, $booking_arr, $listing_arr, $type)
{
if (!in_array($type, array(‘confirm’, ‘payment’)))
{
return false;
}
Object::import(‘Component’, ‘Email’);
$Email = new Email();
//print_r($listing_arr);
//die;
$search = array(
'{ListingName}','{Name}', '{Email}', '{Phone}', '{Notes}',
'{CCType}', '{CCNum}', '{CCExp}', '{CCSec}',
'{PaymentMethod}', '{ListingID}',
'{StartDate}', '{EndDate}', '{ReservationID}',
'{NightlyCost}', '{ExtraMileCost}', '{PrepFee}', '{InsuranceFee}', '{CleaningFee}', '{PetFee}', '{RoadsideFee}', '{DeliveryFee}', '{SalesTax}', '{TotalPrice}', '{ProcessingFee}', '{GrandTotalPrice}', '{SecurityDeposit}');
//'{Deposit}', '{Price}', '{Tax}', '{Security}', '{Total}');
$replace = array(
$listing_arr['listing_title_'.$this->getLanguage()],$booking_arr['name'], $booking_arr['email'], $booking_arr['phone'], $booking_arr['notes'],
$booking_arr['cc_type'], $booking_arr['cc_num'], ($booking_arr['payment_method'] == 'creditcard' ? $booking_arr['cc_exp'] : NULL), $booking_arr['cc_code'],
$booking_arr['payment_method'], $booking_arr['listing_id'],
$booking_arr['date_from'], $booking_arr['date_to'], $booking_arr['id'],
$booking_arr['nightly_cost']." ".$option_arr['currency'], $booking_arr['extraMile_price']." ".$option_arr['currency'], $booking_arr['prep_fee']." ".$option_arr['currency'], $booking_arr['insurance_fee']." ".$option_arr['currency'], $booking_arr['cleaning_fee']." ".$option_arr['currency'], $booking_arr['pet_fee']." ".$option_arr['currency'], $booking_arr['roadside_fee']." ".$option_arr['currency'], $booking_arr['delivery_fee']." ".$option_arr['currency'], $booking_arr['sales_tax']." ".$option_arr['currency'], $booking_arr['base_total']." ".$option_arr['currency'], $booking_arr['processing_fee']." ".$option_arr['currency'], $booking_arr['grand_total']." ".$option_arr['currency'], $booking_arr['security_deposit']." ".$option_arr['currency']
//$booking_arr['deposit'] . " " . $option_arr['currency'], $booking_arr['amount'] . " " . $option_arr['currency'], $booking_arr['tax'] . " " . $option_arr['currency'], $booking_arr['security'] . " " . $option_arr['currency'], ($booking_arr['amount'] + $booking_arr['security'] + $booking_arr['tax']) . " " . $option_arr['currency']
);
$lang_id = isset($_SESSION['front_language']) && !empty($_SESSION['front_language']) ? $_SESSION['front_language'] : 1;
include APP_PATH . 'locale/' . $lang_id . '.php';
$c_subject = $PLS_LANG['front_email_confirm_subject'];
$p_subject = $PLS_LANG['front_email_payment_subject'];
switch ($type)
{
case 'confirm':
$message = str_replace($search, $replace, $listing_arr['o_confirm_tokens_1']);
//die($message);
//client
$Email->send($booking_arr['email'], $c_subject, $message, $option_arr['email_address']);
// Hard core
//$listing_arr['contact_send'] = 1;
switch ($listing_arr['contact_send'])
{
case 1:
//owner
$Email->send($listing_arr['contact_email'], $c_subject, $message, $option_arr['email_address']);
break;
case 2:
//admin
$Email->send($option_arr['email_address'], $c_subject, $message, $booking_arr['email']);
break;
case 3:
//both
$Email->send($listing_arr['contact_email'], $c_subject, $message, $option_arr['email_address']);
$Email->send($option_arr['email_address'], $c_subject, $message, $booking_arr['email']);
break;
}
break;
case 'payment':
$message = str_replace($search, $replace, $listing_arr['o_payment_tokens_1']);
//client
$Email->send($booking_arr['email'], $p_subject, $message, $option_arr['email_address']);
// Hard core
//$listing_arr['contact_send'] = 1;
switch ($listing_arr['contact_send'])
{
case 1:
//owner
$Email->send($listing_arr['contact_email'], $p_subject, $message, $option_arr['email_address']);
break;
case 2:
//admin
$Email->send($option_arr['email_address'], $p_subject, $message, $booking_arr['email']);
break;
case 3:
//both
$Email->send($listing_arr['contact_email'], $p_subject, $message, $option_arr['email_address']);
$Email->send($option_arr['email_address'], $p_subject, $message, $booking_arr['email']);
break;
}
break;
}
}