-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Currently isn't possible to perform auto translate when used options value. F.e. config
'sxmail' => [
'configs' => [
'default' => [
// ...
'message' => [
'options' => [
'subject' => 'Hey no body is perfect',
],
],
],this 'Hey no body is perfect' needed to be translated for different countries. I have no idea how to done this. Please help me :) thx!
BTW
// TODO: DI never initiate an instance via new operator maybe we need $this->getMessage() and I can use $this->setMessage($message// from factory) to
/**
* Compose a new message.
*
* @param mixed $body Accepts instance of ViewModel, string and null.
* @param string $mimeType
*
* @return \Zend\Mail\Message
* @throws \SxMail\Exception\InvalidArgumentException
*/
public function compose($body = null, $mimeType = null)
{
// Supported types are null, ViewModel and string.
if (null !== $body && !is_string($body) && !($body instanceof ViewModel)) {
throw new InvalidArgumentException(
'Invalid value supplied. Expected null, string or instance of Zend\View\Model\ViewModel.'
);
}
$body = $this->manipulateBody($body, $mimeType);
$message = new Message; // TODO: (DI fault) never initiate via new operator maybe $this->getMessage() and I can use $this->setMessage($message// from factory)
$message->setBody($body);
if ($this->config['message']['generate_alternative_body'] && count($body->getParts()) > 1) {
$message->getHeaders()->get('content-type')->setType('multipart/alternative');
}
$this->applyMessageHeaders($message);
$this->applyMessageOptions($message);
return $message;
}Metadata
Metadata
Assignees
Labels
No labels