mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
v6 update
This commit is contained in:
@ -7,6 +7,7 @@ use Crater\Models\Estimate;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class SendEstimateMail extends Mailable
|
||||
{
|
||||
@ -32,7 +33,7 @@ class SendEstimateMail extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
EmailLog::create([
|
||||
$log = EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
@ -41,6 +42,11 @@ class SendEstimateMail extends Mailable
|
||||
'mailable_id' => $this->data['estimate']['id'],
|
||||
]);
|
||||
|
||||
$log->token = Hashids::connection(EmailLog::class)->encode($log->id);
|
||||
$log->save();
|
||||
|
||||
$this->data['url'] = route('estimate', ['email_log' => $log->token]);
|
||||
|
||||
$mailContent = $this->from($this->data['from'], config('mail.from.name'))
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.estimate', ['data', $this->data]);
|
||||
|
||||
@ -7,6 +7,7 @@ use Crater\Models\Invoice;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class SendInvoiceMail extends Mailable
|
||||
{
|
||||
@ -32,7 +33,7 @@ class SendInvoiceMail extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
EmailLog::create([
|
||||
$log = EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
@ -41,6 +42,11 @@ class SendInvoiceMail extends Mailable
|
||||
'mailable_id' => $this->data['invoice']['id'],
|
||||
]);
|
||||
|
||||
$log->token = Hashids::connection(EmailLog::class)->encode($log->id);
|
||||
$log->save();
|
||||
|
||||
$this->data['url'] = route('invoice', ['email_log' => $log->token]);
|
||||
|
||||
$mailContent = $this->from($this->data['from'], config('mail.from.name'))
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.invoice', ['data', $this->data]);
|
||||
|
||||
@ -7,6 +7,7 @@ use Crater\Models\Payment;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Vinkla\Hashids\Facades\Hashids;
|
||||
|
||||
class SendPaymentMail extends Mailable
|
||||
{
|
||||
@ -32,7 +33,7 @@ class SendPaymentMail extends Mailable
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
EmailLog::create([
|
||||
$log = EmailLog::create([
|
||||
'from' => $this->data['from'],
|
||||
'to' => $this->data['to'],
|
||||
'subject' => $this->data['subject'],
|
||||
@ -41,6 +42,11 @@ class SendPaymentMail extends Mailable
|
||||
'mailable_id' => $this->data['payment']['id'],
|
||||
]);
|
||||
|
||||
$log->token = Hashids::connection(EmailLog::class)->encode($log->id);
|
||||
$log->save();
|
||||
|
||||
$this->data['url'] = route('payment', ['email_log' => $log->token]);
|
||||
|
||||
$mailContent = $this->from($this->data['from'], config('mail.from.name'))
|
||||
->subject($this->data['subject'])
|
||||
->markdown('emails.send.payment', ['data', $this->data]);
|
||||
|
||||
Reference in New Issue
Block a user