Merge pull request #7 from franknstayn/local_dev

Local dev
This commit is contained in:
franknstayn
2020-01-25 18:43:25 +08:00
committed by GitHub
3 changed files with 42 additions and 4 deletions

View File

@@ -307,24 +307,44 @@ class PaypalController extends Controller {
$array_payment_details = $newUserModel->selectPaymentDetails('CartKey', $cartKey);
$array_storename = $newUserModel->selectTeamStoreName($cartKey); // email subject
foreach($array_storename as $storname){
$sName[] = $storname->StoreName;
$sid[] = $storname->Id;
}
$sName = implode (", ", $sName);
$user_loginsArray = $newUserModel->selectUserLoginsWhereIn($sid);
foreach($user_loginsArray as $userdata){
$other_email[] = $userdata->other_email;
}
if($other_email[0] != null){
$other_email = implode (", ", $other_email);
$email_cc = "orders@crewsportswear.com" . "," . $other_email;
}else{
$email_cc = "orders@crewsportswear.com";
}
$explode_other_email = explode(",", $email_cc);
$data = array(
'order_item_array' => $order_item_array,
'item_goup_array' => $item_goup_array,
'img_thumb' => $item_thumbs,
'array_payment_details' => $array_payment_details,
'receiver' => $user_email,
'email_cc' => $explode_other_email,
'subject' => $sName . ' ORDERS',
);
Mail::send('emails.orders', $data, function($message) use ($data) {
$message->from('no-reply@crewsportswear.com', 'CREW Sportswear');
$message->cc('orders@crewsportswear.com', 'Orders From CREW Sportswear');
$message->bcc($data['email_cc'], 'Orders From CREW Sportswear');
$message->to($data['receiver'])->subject($data['subject']);
});
// end email sending