I've recently inherited some websites from the developer that was here before me, and I'm having trouble adding a simple IF statement to his code.
The page simply says that "an error has occurred" and there's nothing being written to the logs folder.
Here is the code:
protected function sendContactEmail($data)
{
$enquiry = $data['enquiry'];
$email = $data['email'];
$name = $data['name'];
if($enquiry=='General Enquiry'){
$to = '********';
$cc = '********';
}
else if($enquiry=='Product Feedback'){
$to = '********';
$cc = '********';
}
else { //Trade Enquiry
$to = '********';
}
//email to admin
Mail::send('contact.email.contact-admin', $data, function ($message) use ($enquiry) {
$message->from('no-reply@********.com.au', '********');
$message->replyTo('no-reply@********.com.au', '********');
$message->subject($enquiry);
$message->to($to);
$message->cc($cc);
});
//email to user
Mail::send('contact.email.contact-user', $data, function ($message2) use ($email) {
$message2->from('no-reply@********.com.au', '********');
$message2->replyTo('no-reply@********.com.au', '********');
$message2->subject('********');
$message2->to($email);
});
}
Anyone got any ideas on where to start?
$ccisn't given a default value. When$enquiryis matches none of the conditions,$ccis never initialized.