PHP code example of mailyte / laravel-email-templates
1. Go to this page and download the library: Download mailyte/laravel-email-templates library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mailyte / laravel-email-templates example snippets
use Mailyte\EmailTemplates\Facades\Mailyte;
Mailyte::template('email-changed')
->with([
'old_email' => $user->email,
'new_email' => $request->string('email'),
'cancel_url' => URL::signedRoute('account.email.cancel', $user),
])
->send($user); // or ->queue($user)
class AddressChanging extends Mailable
{
use Queueable, SerializesModels, UsesMailyteTemplate;
public function __construct(private User $user, private string $newAddress) {}
protected function mailyte(): TemplateBuilder
{
return Mailyte::template('email-changed')->with([...]);
}
}