The Mail component allows you to describe an email and send it whenever needed.
Containers MAY or MAY NOT have one or more Mail.
Ship may contain general Mails.
- All Notifications MUST extend from
- Email Templates must be placed inside the Mail directory in a Templates directory
A simple Mail
class UserRegisteredMail extends Mail implements ShouldQueue
public function __construct(User $user)
$this->user = $user;
public function build()
'name' => $this->user->name,
Usage from an Action
Notifications can be sent from Actions or Tasks using the
Templates should be placed inside a folder
Templates inside the
To access a Mail template (same like accessing a web view) you must call the camelCase of its Section name +
@ + camelCase of its Container name.
In the example below we're using the
user-registered.blade.php template in the
AppSection Section >
.env file and set the
from mail and address. This will be used globally whenever the
from function is not called in the Mail.
To use different email address in some classes add
->to($this->email, $this->name) to the
build function in your Mail class.
By default Apiato is configured to use Log Driver
MAIL_DRIVER=log, you can change that from the
Queueing A Notification
To queue a notification you should use
Illuminate\Bus\Queueable and implement
More info at Laravel Docs.