fix merge conflicts

This commit is contained in:
Mohit Panjwani
2020-01-31 14:28:16 +05:30
12 changed files with 35 additions and 39 deletions

View File

@@ -175,12 +175,6 @@ class EstimatesController extends Controller
]);
}
if (!config('mail.from.name')) {
return response()->json([
'error' => 'from_email_does_not_exist'
]);
}
\Mail::to($email)->send(new EstimatePdf($data));
}
@@ -343,12 +337,6 @@ class EstimatesController extends Controller
]);
}
if (!config('mail.from.name')) {
return response()->json([
'error' => 'from_email_does_not_exist'
]);
}
\Mail::to($email)->send(new EstimatePdf($data));
if ($estimate->status == Estimate::STATUS_DRAFT) {

View File

@@ -12,7 +12,7 @@ use Crater\Invoice;
use Crater\InvoiceItem;
use Carbon\Carbon;
use Crater\Item;
use Crater\Mail\invoicePdf;
use Crater\Mail\InvoicePdf;
use function MongoDB\BSON\toJSON;
use Illuminate\Support\Facades\Log;
use Crater\User;
@@ -175,6 +175,7 @@ class InvoicesController extends Controller
]);
}
<<<<<<< HEAD
if (!config('mail.from.name')) {
return response()->json([
'error' => 'from_email_does_not_exist'
@@ -182,6 +183,9 @@ class InvoicesController extends Controller
}
\Mail::to($email)->send(new invoicePdf($data));
=======
\Mail::to($email)->send(new InvoicePdf($data));
>>>>>>> c2eb22d66634a3b57d7ebade6ab9c7b359047c93
}
$invoice = Invoice::with(['items', 'user', 'invoiceTemplate', 'taxes'])->find($invoice->id);
@@ -410,6 +414,7 @@ class InvoicesController extends Controller
]);
}
<<<<<<< HEAD
if (!config('mail.from.name')) {
return response()->json([
'error' => 'from_email_does_not_exist'
@@ -417,6 +422,9 @@ class InvoicesController extends Controller
}
\Mail::to($email)->send(new invoicePdf($data));
=======
\Mail::to($email)->send(new InvoicePdf($data));
>>>>>>> c2eb22d66634a3b57d7ebade6ab9c7b359047c93
if ($invoice->status == Invoice::STATUS_DRAFT) {
$invoice->status = Invoice::STATUS_SENT;

View File

@@ -305,10 +305,6 @@ class PaymentController extends Controller
$data['user'] = User::find($userId)->toArray();
$data['company'] = Company::find($payment->company_id);
$email = $data['user']['email'];
$notificationEmail = CompanySetting::getSetting(
'notification_email',
$request->header('company')
);
if (!$email) {
return response()->json([
@@ -316,13 +312,7 @@ class PaymentController extends Controller
]);
}
if (!$notificationEmail) {
return response()->json([
'error' => 'notification_email_does_not_exist'
]);
}
\Mail::to($email)->send(new PaymentPdf($data, $notificationEmail));
\Mail::to($email)->send(new PaymentPdf($data));
return response()->json([
'success' => true

View File

@@ -29,6 +29,9 @@ class EstimatePdf extends Mailable
*/
public function build()
{
return $this->markdown('emails.send.estimate', ['data', $this->data]);
$company = $this->data['company']['name'];
return $this->subject("Estimate from $company")
->markdown('emails.send.estimate', ['data', $this->data]);
}
}

View File

@@ -31,6 +31,8 @@ class EstimateViewed extends Mailable
public function build()
{
$email = $this->data['user']['email'];
return $this->from($email)->markdown('emails.viewed.estimate', ['data', $this->data]);
$name = $this->data['user']['name'];
return $this->from($email, $name)
->markdown('emails.viewed.estimate', ['data', $this->data]);
}
}

View File

@@ -6,7 +6,7 @@ use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class invoicePdf extends Mailable
class InvoicePdf extends Mailable
{
use Queueable, SerializesModels;
@@ -29,6 +29,9 @@ class invoicePdf extends Mailable
*/
public function build()
{
return $this->markdown('emails.send.invoice', ['data', $this->data]);
$company = $this->data['company']['name'];
return $this->subject("Invoice from $company")
->markdown('emails.send.invoice', ['data', $this->data]);
}
}

View File

@@ -31,6 +31,8 @@ class InvoiceViewed extends Mailable
public function build()
{
$email = $this->data['user']['email'];
return $this->from($email)->markdown('emails.viewed.invoice', ['data', $this->data]);
$name = $this->data['user']['name'];
return $this->from($email, $name)
->markdown('emails.viewed.invoice', ['data', $this->data]);
}
}

View File

@@ -13,17 +13,14 @@ class PaymentPdf extends Mailable
public $data = [];
public $notificationEmail = '';
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($data, $notificationEmail)
public function __construct($data)
{
$this->data = $data;
$this->notificationEmail = $notificationEmail;
}
/**
@@ -33,6 +30,9 @@ class PaymentPdf extends Mailable
*/
public function build()
{
return $this->from($this->notificationEmail)->markdown('emails.send.payment', ['data', $this->data]);
$company = $this->data['company']['name'];
return $this->subject("Payment from $company")
->markdown('emails.send.payment', ['data', $this->data]);
}
}