| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
-
- namespace App\Mail;
-
- use App\Models\Order;
- use Illuminate\Bus\Queueable;
- use Illuminate\Mail\Mailable;
- use Illuminate\Mail\Mailables\Content;
- use Illuminate\Mail\Mailables\Envelope;
- use Illuminate\Queue\SerializesModels;
-
- /**
- * Sent to the shopper when the merchant marks their order as shipped. Written in the store's language.
- */
- class OrderShipped extends Mailable
- {
- use Queueable, SerializesModels;
-
- public function __construct(public Order $order) {}
-
- public function envelope(): Envelope
- {
- $store = $this->order->store;
-
- return new Envelope(
- subject: $store->language->value === 'ms'
- ? "Pesanan #{$this->order->number} telah dihantar - {$store->name}"
- : "Order #{$this->order->number} is on its way - {$store->name}",
- );
- }
-
- public function content(): Content
- {
- return new Content(
- markdown: 'mail.orders.shipped',
- with: [
- 'order' => $this->order->loadMissing('items'),
- 'store' => $this->order->store,
- 'malay' => $this->order->store->language->value === 'ms',
- ],
- );
- }
- }
|