File: D:/HostingSpaces/SBogers10/debierbaron.komma.pro/data/app/Komma/Mailers/MailService.php
<?php
namespace Komma\Mailers;
use Illuminate\Support\Facades\Input;
class MailService extends Mailer
{
public function offer($inputs){
$this->makeRules(
[
'contactName'=> 'required',
'emailForm'=> 'required|email',
'formMessage'=> 'required',
]);
$validated = $this->validate($inputs);
if($validated && is_bool($validated))
{
$view = 'emails.contactForm';
$to = \Config::get('mail.sendTo.address');
$subject = 'Contactformulier Website';
$this->sendTo($to, $subject, $view, $inputs);
return 'true';
}
else{
$error = [];
if($validated->first('contactName')!=""){
$error['contactName'] = $validated->first('contactName');
}
if($validated->first('emailForm')!=""){
$error['emailForm'] = $validated->first('emailForm');
}
if($validated->first('formMessage')!=""){
$error['formMessage'] = $validated->first('formMessage');
}
return $error;
}
}
/**
* @param $order
*/
public function sendCustomerPaidMail($order)
{
$view = 'emails.shop.customerPaid';
$to = $order->invoice_email;
$subject = \Lang::get('emails.paid.subject');
$this->sendTo($to, $subject, $view, $order->toArray());
}
/**
* @param $order
*/
public function sendAdminPaidMail($order){
$view = 'emails.shop.adminPaid';
$to = \Config::get('bierbaron.order_email');
$subject = \Lang::get('emails.paid.subject');
$this->sendTo($to, $subject, $view, $order->toArray());
}
/**
* @param $subscription
* @param $transactionRequest
*/
public function sendTransactionRequestMail($subscription, $transactionRequest)
{
$view = 'emails.shop.transactionRequest';
$to = $subscription->invoice_email;
$subject = \Lang::get('emails.paid.subject');
$subscription['transactionRequest'] = $transactionRequest->toArray();
$this->sendTo($to, $subject, $view, $subscription->toArray());
}
}