Creates a new forwarder.

@param Domain $domain
@param string $prefix
@param string|string[] $recipients
@return Forwarder
960585
public static function create(Domain $domain, $prefix, $recipients)
    {
        $domain->invokePost('EMAIL_FORWARDERS', 'create', [
            'user' => $prefix,
            'email' => is_array($recipients) ? implode(',', $recipients) : $recipients,
        ]);
        return new self($prefix, $domain, $recipients);
    }
670412
private function prepareRequest(MessageInterface $message, RecipientInterface $recipient) {
        if (!$this->getApiKey()) {
            throw new \RuntimeException("No API Key provided.");
        }

        $uri = new Uri($recipient->getEndpoint());
        return Pusher::createStandardRequest($message, $recipient)
            ->withUri($uri)
            ->withHeader('Authorization', sprintf('key=%s', $this->getApiKey()));
    }
1316712
public static function groupPrefix(string $prefix, $origin, $target = null)
    {
        $target = is_object($target) ? (object) $target : (array) $target;

        foreach ((array) $origin as $key => $row) {
            if (strpos($key, $prefix) === 0) {
                $key2 = Mbstring::substr($key, Mbstring::strlen($prefix));
                $target = Arr::set($target, $key2, $row);
            }
        }

        return $target;
    }
303023
private function createV1Website($name, $ipAddress, $https, array $domains, array...$siteApps)
    {

        return $this->send('create_website', $name, $ipAddress, $https, $domains, ...$siteApps);
    }
859585
protected function addRecipient(string $headerName, string $address, array $variables): MessageBuilder
    {
        if (array_key_exists($headerName, $this->counters['recipients'])) {
            if (self::RECIPIENT_COUNT_LIMIT === $this->counters['recipients'][$headerName]) {
                if (false === $this->autoSend) {
                    throw TooManyRecipients::whenAutoSendDisabled();
                }
                $this->finalize();
            }
        }

        parent::addRecipient($headerName, $address, $variables);

        if (array_key_exists($headerName, $this->counters['recipients']) && !array_key_exists('id', $variables)) {
            $variables['id'] = $headerName.'_'.$this->counters['recipients'][$headerName];
        }

        $this->batchRecipientAttributes[$address] = $variables;

        return $this;
    }
494357
public function domain($domain, $protocol = null) {

		if(false === is_string($domain)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
		}

		//Check if identifier exists
		if(false === Router :: routeExists($this -> identifier, $domain)) {
			return trigger_error(sprintf('Identifier "%s" with domain "%s" does not exists', $this -> identifier, $domain), E_USER_ERROR);	
		}

		if(null !== $protocol && false === is_string($protocol)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($protocol)), E_USER_ERROR);
		}

		if(null === $protocol) {
			$protocol = Request :: getScheme();
		}

		$this -> domain = sprintf('%s://%s', $protocol, $domain);

		return $this;
	}
215204
public function setReplyTo(array $addresses): Email
    {
        $addresses = $this->transformAddressesToArray($addresses);
        $this->message->setReplyTo($addresses);

        return $this;
    }
948572
private function set_domain_results($users, $domain, $val)
        {
            if (!Arrays::is($users)) {
                $users = (array) $users;
            }
            foreach ($users as $user) {
                $this->results[$user . '@' . $domain] = $val;
            }
        }
1236933
public function addDomain(DomainConfiguration ...$domains)
    {
        foreach ($domains as $domain) {
            $this->domains[$domain->getDomainName()] = $domain;
        }

        return $this;
    }
64716
public function create($domain, $type, $protocol)
    {
        try {
            $this->socket = socket_create($domain, $type, $protocol);
        } catch (\Exception $e) {
            throw new CreateSocketException($e->getMessage());
        }
    }
1356296
public function domain($domain = null) {

		if(null !== $domain) {

			if(false === is_string($domain)) {
				return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
			}

			//Check if identifier exists
			if(false === Router :: routeExists($this -> identifier, $domain)) {
				return trigger_error(sprintf('Identifier "%s" with domain "%s" does not exists', $this -> identifier, $domain), E_USER_ERROR);	
			}

			$this -> domain = $domain;
		}

		return $this;
	}
1153090
public function addRecipient($recipients, $prepend = false)
    {
        if (!$prepend) {
            $this->appendRecipient($recipients);
        } else {
            $this->prependRecipient($recipients);
        }

        return $this;
    }
960767
public function setRecipients($type, array $recipients = [])
    {
        foreach ($recipients as $key => $recipient) {
            $this->setRecipient(
                $type,
                array_get($recipient, 'email'),
                array_get($recipient, 'name')
            );
        }

        return $this;
    }
926514
public function action(string $recipient, string $action, array $options = []): SendResponse
    {
        $this->isValidSenderAction($action);
        $options = $this->isValidOptions($options, $action);

        $request = new SendRequest($this->pageToken, $action, $recipient, $options, SendRequest::REQUEST_TYPE_ACTION);
        $response = $this->client->post('me/messages', $request->build());

        return new SendResponse($response);
    }
1273936
private function doMailTransaction($message, $reversePath, array $recipients, array &$failedRecipients)
    {
        $sent = 0;
        $this->doMailFromCommand($reversePath);
        foreach ($recipients as $forwardPath) {
            try {
                $this->doRcptToCommand($forwardPath);
                ++$sent;
            } catch (Swift_TransportException $e) {
                $failedRecipients[] = $forwardPath;
            } catch (Swift_AddressEncoderException $e) {
                $failedRecipients[] = $forwardPath;
            }
        }

        if (0 != $sent) {
            $sent += count($failedRecipients);
            $this->doDataCommand($failedRecipients);
            $sent -= count($failedRecipients);

            $this->streamMessage($message);
        } else {
            $this->reset();
        }

        return $sent;
    }
955031
public function addResourcePaths($domain, array $paths) {
        foreach ($paths as $path) {
            $this->_paths[$domain][] = $path;
        }

        return $this;
    }
189694
private function createReplays($addresses) {
        if (is_array($addresses) && count($addresses) > 0) {
            foreach ($addresses as $address) {
                $this->mailer->addReplyTo($address);
            }
        } else if (!empty($addresses)) {
            $this->mailer->addReplyTo($addresses);
        }
    }