Skip to content

Commit

Permalink
add send code email
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jun 26, 2024
1 parent 95cb940 commit 13d8f2d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/Mail/V1/Customer/SendCodeNotification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace NexaMerchant\Apis\Mail\V1\Customer;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class SendCodeNotification extends Mailable
{
use Queueable, SerializesModels;

/**
* Create a new mailable instance.
*
* @param \Webkul\Customer\Contracts\Customer $customer
* @return void
*/
public function __construct(public $code, public $customer)
{
}

/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
->to($this->customer->email)
->subject(trans('apis::app.emails.customers.sendcode.subject'))
->view('Apis::emails.v1.customers.sendcode', [
'code' => $this->code,
]);
}
}
9 changes: 9 additions & 0 deletions src/Resources/views/emails/v1/customers/sendcode.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Login Code</title>
</head>
<body>
<p>Your login code is: {{ $code }}</p>
</body>
</html>

0 comments on commit 13d8f2d

Please sign in to comment.