public function getAddressesForType($type)
    {
        if (!isset($this->addresses[$type])) {
            throw new \Parable\Mail\Exception('Only to, cc, bcc addresses are allowed.');
        }

        $addresses = [];
        foreach ($this->addresses[$type] as $address) {
            if (!empty($address['name'])) {
                $addresses[] = $address['name'] . ' <' . $address['email'] . '>';
            } else {
                $addresses[] = $address['email'];
            }
        }
        return implode(', ', $addresses);
    }
public function getAddressesForType($type)
    {
        if (!isset($this->addresses[$type])) {
            throw new \Parable\Mail\Exception('Only to, cc, bcc addresses are allowed.');
        }

        $addresses = [];
        foreach ($this->addresses[$type] as $address) {
            if (!empty($address['name'])) {
                $addresses[] = $address['name'] . ' <' . $address['email'] . '>';
            } else {
                $addresses[] = $address['email'];
            }
        }
        return implode(', ', $addresses);
    }
public function getAddressesForType ( $ type ) { if ( ! isset ( $ this -> addresses [ $ type ] ) ) { throw new \ Parable \ Mail \ Exception ( 'Only to, cc, bcc addresses are allowed.' ) ; } $ addresses = [ ] ; foreach ( $ this -> addresses [ $ type ] as $ address ) { if ( ! empty ( $ address [ 'name' ] ) ) { $ addresses [ ] = $ address [ 'name' ] . ' <' . $ address [ 'email' ] . '>' ; } else { $ addresses [ ] = $ address [ 'email' ] ; } } return implode ( ', ' , $ addresses ) ; }
Return all addresses for type.

@param string $type

@return string
@throws \Parable\Mail\Exception
Return all addresses for type .