Apiato mails are just Laravel Mails, and they function in the exact same way as Laravel mails. However, they come with additional rules and conventions specific to Apiato.
To generate new mails, you may use the apiato:make:mail
interactive command:
php artisan apiato:make:mail
Rules
- All container-specific Mails MUST be placed in the
app/Containers/{Section}/{Container}/Mails
directory. - All container-specific email templates MUST be placed in the
app/Containers/{Section}/{Container}/Mails/Templates
directory. - All general Mails MUST be placed in the
app/Ship/Mails
directory. - All general email templates MUST be placed in the
app/Ship/Mails/Templates
directory. - All Mails MUST extend the
App\Ship\Parents\Mails\Mail
class.- The parent extension SHOULD be aliased as
ParentMail
.
- The parent extension SHOULD be aliased as
Folder Structure
app
├── Containers
│ └── Section
│ └── Container
│ └── Mails
│ ├── ForgetPassword.php
│ ├── ...
│ └── Templates
│ ├─ ─ forgot-password.blade.php
│ └── ...
└── Ship
└── Mails
└── Newsletter.php
├── ...
└── Templates
├── newsletter.blade.php
└── ...
Code Example
Mails are defined exactly as you would define them in Laravel.
Template Namespaces
Refer to Views documentation for more information on template namespaces.