mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
build version 400
This commit is contained in:
@ -7,7 +7,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class EstimateViewed extends Mailable
|
||||
class EstimateViewedMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@ -7,7 +7,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class InvoiceViewed extends Mailable
|
||||
class InvoiceViewedMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
<?php
|
||||
namespace Crater\Mail;
|
||||
|
||||
use Crater\Models\EmailLog;
|
||||
use Crater\Models\Estimate;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class EstimatePdf extends Mailable
|
||||
class SendEstimateMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@ -29,9 +31,18 @@ class EstimatePdf extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$company = $this->data['company']['name'];
|
||||
EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
'body' => $this->data['body'],
|
||||
'mailable_type' => Estimate::class,
|
||||
'mailable_id' => $this->data['estimate']['id']
|
||||
]);
|
||||
|
||||
return $this->subject("Estimate from $company")
|
||||
return $this->from($this->data['from'])
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.estimate', ['data', $this->data]);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,14 @@
|
||||
<?php
|
||||
namespace Crater\Mail;
|
||||
|
||||
use Crater\Models\EmailLog;
|
||||
use Crater\Models\Invoice;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class InvoicePdf extends Mailable
|
||||
class SendInvoiceMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@ -29,9 +31,17 @@ class InvoicePdf extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$company = $this->data['company']['name'];
|
||||
EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
'body' => $this->data['body'],
|
||||
'mailable_type' => Invoice::class,
|
||||
'mailable_id' => $this->data['invoice']['id']
|
||||
]);
|
||||
|
||||
return $this->subject("Invoice from $company")
|
||||
return $this->from($this->data['from'])
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.invoice', ['data', $this->data]);
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,14 @@
|
||||
|
||||
namespace Crater\Mail;
|
||||
|
||||
use Crater\Models\EmailLog;
|
||||
use Crater\Models\Payment;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class PaymentPdf extends Mailable
|
||||
class SendPaymentMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
@ -30,9 +32,18 @@ class PaymentPdf extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$company = $this->data['company']['name'];
|
||||
EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
'body' => $this->data['body'],
|
||||
'mailable_type' => Payment::class,
|
||||
'mailable_id' => $this->data['payment']['id']
|
||||
]);
|
||||
|
||||
return $this->subject("Payment from $company")
|
||||
return $this->from($this->data['from'])
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.payment', ['data', $this->data]);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user