Example #1
0
 public function testAcceptsNameViaConstructor()
 {
     $address = new Address('*****@*****.**', 'ZF DevTeam');
     $this->assertEquals('*****@*****.**', $address->getEmail());
     $this->assertEquals('ZF DevTeam', $address->getName());
 }
 /**
  * Update an existing template
  *
  * @link https://mandrillapp.com/api/docs/templates.html#method=update
  * @param  string $name
  * @param  Address $address
  * @param  string $subject
  * @param  string $html
  * @param  string $text
  * @param  array $labels
  * @return array
  * @throws Exception\RuntimeException If there are more than 10 template labels
  */
 public function updateTemplate($name, Address $address = null, $subject = '', $html = '', $text = '', array $labels = array())
 {
     if (count($labels) > 10) {
         throw new Exception\RuntimeException('Mandrill only supports up to 10 template labels');
     }
     $parameters = array('name' => $name, 'from_email' => $address !== null ? $address->getEmail() : '', 'from_name' => $address !== null ? $address->getName() : '', 'subject' => $subject, 'code' => $html, 'text' => $text, 'labels' => $labels);
     $response = $this->prepareHttpClient('/templates/update.json', $parameters)->send();
     return $this->parseResponse($response);
 }