Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $newLots = [
- [
- 'number' => 1001,
- 'name' => 'Name 1',
- 'category' => 'Category 1',
- 'initiator' => 'Initiator 1',
- 'value' => '100001',
- 'region' => 'Region 1',
- 'deadline' => 'Deadline 1',
- ],
- [
- 'number' => 1002,
- 'name' => 'Name 2',
- 'category' => 'Category 2',
- 'initiator' => 'Initiator 2',
- 'value' => '100002',
- 'region' => 'Region 2',
- 'deadline' => 'Deadline 2',
- ],
- [
- 'number' => 1003,
- 'name' => 'Name 3',
- 'category' => 'Category 3',
- 'initiator' => 'Initiator 3',
- 'value' => '100003',
- 'region' => 'Region 3',
- 'deadline' => 'Deadline 3',
- ],
- ];
- $testCase = "Test case 2";
- $email = new Mail(new From("mp@mp.kz", $testCase));
- $email->addTo(new To("102@mp.kz", "Account Name 1", [ "subject_replacement" => $testCase ]));
- $email->addTo(new To("nurike@gmail.com", "Account Name 3", [ "subject_replacement" => $testCase ]));
- $email->setTemplateId("d-0f5ccfd1a04a466cb21cc01d7caf6343");
- $per = new Personalization();
- $per->addTo(new To("hostmaster@mp.kz", "Account Name 3", [ "subject_replacement" => $testCase ]));
- $per->setHasDynamicTemplate(true);
- $per->addDynamicTemplateData(new Substitution("totalCount", "!new lots count!"));
- $per->addDynamicTemplateData(new Substitution("totalAmount", "!new lots volume!"));
- $per->addDynamicTemplateData(new Substitution("totalOpen", "!total open!"));
- $per->addDynamicTemplateData(new Substitution("items", $newLots));
- $email->addPersonalization($per);
- $sendgrid = new SendGrid(Info::me()->config->SendGrid->apiKey);
- $response = $sendgrid->send($email);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement