Skip to content

Commit

Permalink
initial order emailer
Browse files Browse the repository at this point in the history
  • Loading branch information
mspeake161 committed Feb 17, 2025
1 parent 82190e7 commit 702d16b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/Http/Emailers/OrderEmailer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Http\Emailers;

use App\Http\Emailers\Emailer;

// a class for sending order confirmation emails
class OrderEmailer extends Emailer
{
// sends from [email protected]
public function __construct()
{
$this->name = 'order';
}

// sends email for given order
public function sendOrderConfirmation($order): bool
{
$to = $order->email;
$subject = 'SportsWear - Order Confirmed - #' . $order->id;
$message = 'Hello ' . $order->user->name . ', we have received your order and will get back to you as soon as possible. Your order: ' . $order->order;
return $this->sendEmail($to, $subject, $message);
}
}

0 comments on commit 702d16b

Please sign in to comment.