Issue while using template id
Sameer-hesta opened this issue · 1 comments
Hello
I am trying to use template id in mail. I am using this method
use Mail;
use Illuminate\Mail\Message;
use Sichikawa\LaravelSendgridDriver\SendGrid;
use Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport;
$status = \Mail::send([], [], function (Message $message) {
$message
->to('yy@getnada.com.com')
->embedData([
'personalizations' => [
[
'dynamic_template_data' => [
'title' => 'Subject',
'name' => 'Name',
],
],
],
'template_id' => 'sendgrid template id'
], SendgridTransport::SMTP_API_NAME)
});
But gettin this error
#message: "base64_encode() expects parameter 1 to be string, array given"
#code: 0
#file: "/var/www/html/planetemploye/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php"
#line: 37
#severity: E_WARNING
trace: {
/var/www/html/planetemploye/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php:37 {}
Can you try to use SgEncode()
.
rel: https://github.com/s-ichikawa/laravel-sendgrid-driver#using-with-telescope