/** * Create the mail. * * @param bool $withLayout * @param bool $withTranslation * @param bool $withTranslationDomain * * @return Mail */ protected function createMail($withLayout = false, $withTranslation = false, $withTranslationDomain = false) { $mail = new Mail(); $mail->setType(MailTypes::TYPE_ALL)->setSubject('Subject of template')->setHtmlBody('HTML Body of template')->setBody('Body of template')->setName('test')->setLabel('Test')->setDescription('Description of template')->setEnabled(true)->setTranslationDomain($withTranslationDomain ? 'domain' : null); if ($withLayout) { $mail->setLayout($this->createLayout($withTranslation, $withTranslationDomain)); } if ($withTranslation && !$withTranslationDomain) { $translation = new MailTranslation($mail); $translation->setSubject('Subject of translation')->setHtmlBody('HTML body of translation')->setLocale('fr')->setLabel('Label of translation')->setDescription('Description of translation')->setBody('Body of translation'); } return $mail; }