AcMailer\Controller\Plugin\SendMailPlugin::applyArrayArgs PHP Method

applyArrayArgs() protected method

protected applyArrayArgs ( array $args, string $key )
$args array
$key string
    protected function applyArrayArgs(array $args, $key)
    {
        if (!isset($args[$key])) {
            return;
        }
        $arg = $args[$key];
        $setter = 'set' . ucfirst($key);
        if (is_array($arg)) {
            $this->mailService->getMessage()->{$setter}(array_keys($arg)[0], array_values($arg)[0]);
            return;
        }
        $this->mailService->getMessage()->{$setter}($arg);
    }