Closed Petah closed 2 years ago
Adding nest dynamic data to a personalisation doesn't work.
$personalization->addDynamicTemplateData([ 'user' => [ 'name' => 'test', ], ]);
Throws error:
E_NOTICE Array to string conversion 28 | /vendor/sendgrid/sendgrid/lib/helper/Assert.php | sprintf 54 | /vendor/sendgrid/sendgrid/lib/mail/Substitution.php | SendGrid\Helper\Assert::string 38 | /vendor/sendgrid/sendgrid/lib/mail/Substitution.php | SendGrid\Mail\Substitution::setKey 210 | /vendor/sendgrid/sendgrid/lib/mail/Personalization.php | SendGrid\Mail\Substitution::__construct 184 | /vendor/sendgrid/sendgrid/lib/mail/Personalization.php | SendGrid\Mail\Personalization::addSubstitution 163 | /classes/Helper/EmailComposer.php | SendGrid\Mail\Personalization::addDynamicTemplateData
NM, I figured it out:
$personalization->addDynamicTemplateData('user', [ 'foo' => [ 'bar' => 'test', ], ]);
Issue Summary
Adding nest dynamic data to a personalisation doesn't work.
Steps to Reproduce
Throws error:
Technical details: