public function it_checks_if_recipient_types_are_equal() { $this->beConstructedThrough('to'); $this->equals(RecipientType::to())->shouldReturn(true); $this->equals(RecipientType::cc())->shouldReturn(false); $this->equals(RecipientType::bcc())->shouldReturn(false); }
public function it_should_send_email_with_multiple_recipients(\SendGrid $sendGrid) { $recipient = new Recipient('Jane Doe', '*****@*****.**'); $anotherRecipient = new Recipient('John Doe', '*****@*****.**'); $ccRecipient = new Recipient('Bruce Wayne', '*****@*****.**', RecipientType::cc()); $bccRecipient = new Recipient('Clark Kent', '*****@*****.**', RecipientType::bcc()); $this->addRecipient($recipient); $this->addRecipient($anotherRecipient); $this->addRecipient($ccRecipient); $this->addRecipient($bccRecipient); $email = new \SendGrid\Email(); $email->setFrom('*****@*****.**'); $email->setFromName('Master Jedi Yoda'); $email->addSmtpapiTo('*****@*****.**', 'Jane Doe'); $email->addSmtpapiTo('*****@*****.**', 'John Doe'); $email->addSmtpapiTo('*****@*****.**', 'Bruce Wayne'); $email->addSmtpapiTo('*****@*****.**', 'Clark Kent'); $email->setSubject('Example subject'); $email->setHtml(' '); $email->setTemplateId('example-template'); $sendGrid->send($email)->shouldBeCalled(); $this->send('Example subject', 'example-template')->shouldReturn(true); }
public function it_should_get_recipient_type() { $this->beConstructedWith('John Doe', '*****@*****.**', RecipientType::bcc()); $this->getType()->equals(RecipientType::to())->shouldReturn(false); $this->getType()->equals(RecipientType::bcc())->shouldReturn(true); }