I am using mailersend driver in my laravel application. I have installedmailersend/laravel-driver successfully.
Configured my .env variables,
MAIL_MAILER=mailersendMAILERSEND_API_KEY=xxxxxMAIL_FROM_ADDRESS="no-reply@xxxx" MAIL_FROM_NAME="${APP_NAME}"
My mailable class:
`class ClientAccountCredentials extends Mailable
{
use Queueable, SerializesModels;
public function __construct(
public Client $client,
)
{
}
public function envelope(): Envelope
{
return new Envelope(
to: [$this->client->email],
subject: "Your {$this->client->company->name} Account Credentials"
);
}
public function content(): Content
{
return new Content(
view: 'emails.client-account-credentials',
);
}
public function attachments(): array
{
return [];
}
}`
How it's initiated:
Mail::to( users: $client )->send( mailable: new ClientAccountCredentials( client: $client, ) );
The error
One of template_id or text must be supplied {"userId":1,"exception":"[object] (MailerSend\\Exceptions\\MailerSendAssertException(code: 0): One of template_id or text must be supplied at /var/www/html/project/public_html/vendor/mailersend/mailersend/src/Helpers/GeneralHelpers.php:23)
I am using mailersend driver in my laravel application. I have installed
mailersend/laravel-driver
successfully. Configured my .env variables,MAIL_MAILER=mailersend
MAILERSEND_API_KEY=xxxxx
MAIL_FROM_ADDRESS="no-reply@xxxx" MAIL_FROM_NAME="${APP_NAME}"
My mailable class:
`class ClientAccountCredentials extends Mailable { use Queueable, SerializesModels;
}`
How it's initiated:
Mail::to( users: $client )->send( mailable: new ClientAccountCredentials( client: $client, ) );
The error
One of template_id or text must be supplied {"userId":1,"exception":"[object] (MailerSend\\Exceptions\\MailerSendAssertException(code: 0): One of template_id or text must be supplied at /var/www/html/project/public_html/vendor/mailersend/mailersend/src/Helpers/GeneralHelpers.php:23)