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()); }
public function testAddCc() { $email = new \SendGrid\Email(); $email->addCc('*****@*****.**'); $email->addCc('*****@*****.**'); $this->assertEquals(2, count($email->getCcs())); $cc = $email->getCcs(); $this->assertEquals('*****@*****.**', $cc[0]); $this->assertEquals('*****@*****.**', $cc[1]); // removeCc removes all occurences of data $email->removeCc('*****@*****.**'); $this->assertEquals(1, count($email->getCcs())); $cc = $email->getCcs(); $this->assertEquals('*****@*****.**', $cc[0]); }
public function testAddCc() { $email = new SendGrid\Email(); $email->addCc('foo'); $email->addCc('raz'); $this->assertEquals(2, count($email->getCcs())); $cc_list = $email->getCcs(); $this->assertEquals('foo', $cc_list[0]); $this->assertEquals('raz', $cc_list[1]); // removeTo removes all occurences of data $email->removeCc('raz'); $this->assertEquals(1, count($email->getCcs())); $cc_list = $email->getCcs(); $this->assertEquals('foo', $cc_list[0]); }