1. Go to this page and download the library: Download crow/laravel-email-template 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/ */
$emailTemplate = \Crow\LaravelEmailTemplate\Models\EmailTemplate::query()->where('type', '=', 'user_registration')->first();
$variables = ['var1' => 'content 1']; // variable list
$wrapper = true; // (optional, default: true) use wrapper for email template
$withCopy = true; // (optional, default: true) use copy email template for render
$emailTemplate = EmailTemplateHelper::render($emailTemplate, $variables, $wrapper, $withCopy);
return $emailTemplate;
namespace App;
use Crow\LaravelEmailTemplate\EmailTemplateVariableInterface;
use Crow\LaravelEmailTemplate\Models\EmailTemplate;
class CustomEmailTemplateVariableSiteName implements EmailTemplateVariableInterface
{
public function content(EmailTemplate $emailTemplate): ?string
{
return 'site name';
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.