예제 #1
0
 public function testAddBcc()
 {
     $email = new \SendGrid\Email();
     $email->addBcc('foo');
     $email->addBcc('raz');
     $this->assertEquals(2, count($email->getBccs()));
     $bcc = $email->getBccs();
     $this->assertEquals('foo', $bcc[0]);
     $this->assertEquals('raz', $bcc[1]);
     $email->removeBcc('raz');
     $this->assertEquals(1, count($email->getBccs()));
     $bcc = $email->getBccs();
     $this->assertEquals('foo', $bcc[0]);
 }
 public function testUseHeaders()
 {
     $email = new SendGrid\Email();
     $email->addTo('*****@*****.**')->addBcc('*****@*****.**')->setFrom('*****@*****.**')->setSubject('Subject')->setHtml('Hello You');
     $this->assertFalse($email->useHeaders());
     $email->removeBcc('*****@*****.**');
     $this->assertTrue($email->useHeaders());
     $email->addCc('*****@*****.**');
     $this->assertFalse($email->useHeaders());
     $email->removeCc('*****@*****.**')->setRecipientsinHeader(true);
     $this->assertTrue($email->useHeaders());
     $email->setRecipientsinHeader(false);
     $this->assertFalse($email->useHeaders());
     $email->addBcc('*****@*****.**')->addAttachment('attachment.ext');
     $this->assertTrue($email->useHeaders());
 }