Mailgun\Messages\MessageBuilder::addRecipient PHP Method

addRecipient() protected method

protected addRecipient ( string $headerName, string $address, array $variables )
$headerName string
$address string
$variables array
    protected function addRecipient($headerName, $address, $variables)
    {
        $compiledAddress = $this->parseAddress($address, $variables);
        if (isset($this->message[$headerName])) {
            array_push($this->message[$headerName], $compiledAddress);
        } elseif ($headerName == 'h:reply-to') {
            $this->message[$headerName] = $compiledAddress;
        } else {
            $this->message[$headerName] = [$compiledAddress];
        }
        if (array_key_exists($headerName, $this->counters['recipients'])) {
            $this->counters['recipients'][$headerName] += 1;
        }
    }