SendTemplateMailTest.php 710 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * 模板发送接口
  4. * User: chocoboxxf
  5. * Date: 16/9/23
  6. */
  7. namespace chocoboxxf\SendCloud\Tests;
  8. class SendTemplateMailTest extends BaseTest
  9. {
  10. public function testSend()
  11. {
  12. $subject = '';
  13. $template = 'TEMPLATE_NAME';
  14. $to = ['user_a@company.com', ];
  15. $from = 'admin@company.com';
  16. $fromName = 'Admin';
  17. $templateData = [
  18. 'key1' => 'value1',
  19. 'key2' => 'value2',
  20. ];
  21. $attachments = [
  22. __DIR__ . '/data/test.txt',
  23. __DIR__ . '/data/test.pdf',
  24. ];
  25. var_dump($this->client->sendTemplateMail($template, $to, $from, $fromName, $subject, $templateData, $attachments));
  26. }
  27. }