public function addRecipientMetadata($recipient, $data)
    {
        foreach ($this->recipientMetadata as $idx => $rcptMetadata) {
            if (isset($rcptMetadata['rcpt']) && $rcptMetadata['rcpt'] == $recipient) {
                if (is_array($data)) {
                    foreach ($data as $k => $v) {
                        $this->recipientMetadata[$idx]['values'][$k] = $v;
                    }
                }
                else {
                    $this->recipientMetadata[$idx]['values'][] = $data;
                }
                return $this;
            }
        }

        $this->recipientMetadata[] = array('rcpt' => $recipient, 'values' => is_array($data) ? $data : array($data));

        return $this;
    }
public function addRecipientMetadata($recipient, $data)
    {
        foreach ($this->recipientMetadata as $idx => $rcptMetadata) {
            if (isset($rcptMetadata['rcpt']) && $rcptMetadata['rcpt'] == $recipient) {
                if (is_array($data)) {
                    foreach ($data as $k => $v) {
                        $this->recipientMetadata[$idx]['values'][$k] = $v;
                    }
                }
                else {
                    $this->recipientMetadata[$idx]['values'][] = $data;
                }
                return $this;
            }
        }

        $this->recipientMetadata[] = array('rcpt' => $recipient, 'values' => is_array($data) ? $data : array($data));

        return $this;
    }
public function addRecipientMetadata ( $ recipient , $ data ) { foreach ( $ this -> recipientMetadata as $ idx => $ rcptMetadata ) { if ( isset ( $ rcptMetadata [ 'rcpt' ] ) && $ rcptMetadata [ 'rcpt' ] == $ recipient ) { if ( is_array ( $ data ) ) { foreach ( $ data as $ k => $ v ) { $ this -> recipientMetadata [ $ idx ] [ 'values' ] [ $ k ] = $ v ; } } else { $ this -> recipientMetadata [ $ idx ] [ 'values' ] [ ] = $ data ; } return $ this ; } } $ this -> recipientMetadata [ ] = array ( 'rcpt' => $ recipient , 'values' => is_array ( $ data ) ? $ data : array ( $ data ) ) ; return $ this ; }
Add Per-recipient metadata that will override the global
values specified in the metadata parameter.

@param string $recipient
@param string|array $data

@return Message
Add Per - recipient metadata that will override the global values specified in the metadata parameter .