protected function applyArgsToMailService(array $args)
{
if (isset($args['body'])) {
$body = $args['body'];
if (is_string($body)) {
$this->mailService->setBody($body);
} else {
$this->mailService->setTemplate($body);
}
}
if (isset($args['subject'])) {
$this->mailService->setSubject($args['subject']);
}
if (isset($args['to'])) {
$this->mailService->getMessage()->setTo($args['to']);
}
if (isset($args['cc'])) {
$this->mailService->getMessage()->setCc($args['cc']);
}
if (isset($args['bcc'])) {
$this->mailService->getMessage()->setBcc($args['bcc']);
}
if (isset($args['encoding'])) {
$this->mailService->getMessage()->setEncoding($args['encoding']);
}
if (isset($args['attachments'])) {
$this->mailService->setAttachments($args['attachments']);
}
$this->applyArrayArgs($args, 'from');
$this->applyArrayArgs($args, 'replyTo');
}