Copying emails sent to Guest or Hotel, to another address

 
A regular question is how does a Site Administrator copy emails that are sent from one email address, to their own or another email address.
 
First we need to identify which email you want to copy to another address.
 
  • j03100hotelconfirmationemail.class.php Sends the email that property manager receives on booking.
  • j03110guestconfirmationemail.class.php Sends the email that guest receives on booking.
  • j02190confirmationform.class.php Sends the email that the guest receives on booking confirmation.
  • j06000contactowner.class.php Sends the email that the property manager recieves when a guest uses the Contact Hotel link/captcha based form.
 
 
The code for sending emails is slighly different in each, but the general principle's the same. Collate the information you want to send, insert it into a patTemplate $tmpl object if required then do the actual sending. The sending in j03100hotelconfirmationemail.class.php is done by these lines:
 
 
if (!jomresMailer( $useremail, $propertyName, $hotelemail, $subject, $text,$mode=1))
error_logging('Failure in sending confirmation email to hotel. Target address: '.$hotelemail.' Subject'.$subject);
 
 
so all you need to do is copy these lines and replace the hotel email's address with your new target email. Let's say we're using test@test.com, then you'd add some lines so that the above was changed to something like...
 
 
 
if (!jomresMailer( $useremail, $propertyName, $hotelemail, $subject, $text,$mode=1))
error_logging('Failure in sending confirmation email to hotel. Target address: '.$hotelemail.' Subject'.$subject);
if (!jomresMailer( $useremail, $propertyName, "test@test.com", $subject, $text,$mode=1))
error_logging('Failure in sending confirmation email to hotel. Target address: '.'test@test.com'.' Subject'.$subject);
 
 
This document is copyright Vince Wooll/Woollyinwales IT, 2011. All rights reserved.