Skip to content
Snippets Groups Projects
Commit 15859bab authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Saving templates for specific site root id

parent adf58516
No related branches found
No related tags found
1 merge request!2Feature multiclient
...@@ -340,6 +340,7 @@ class MailController extends ActionController { ...@@ -340,6 +340,7 @@ class MailController extends ActionController {
$template->setCc($selectedCc); $template->setCc($selectedCc);
$template->setBcc($selectedBcc); $template->setBcc($selectedBcc);
$template->setReplyTo($selectedReplyTo); $template->setReplyTo($selectedReplyTo);
$template->setSiteRootId($siteRootId);
if ($templateAlreadyExists) { if ($templateAlreadyExists) {
$this->templateRepository->update($template); $this->templateRepository->update($template);
......
...@@ -313,6 +313,7 @@ class MailTemplateService { ...@@ -313,6 +313,7 @@ class MailTemplateService {
* *
* @param boolean $isPreview * @param boolean $isPreview
* @return boolean email was sent or added to mail queue successfully? * @return boolean email was sent or added to mail queue successfully?
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/ */
public function sendEmail($isPreview = FALSE) { public function sendEmail($isPreview = FALSE) {
/** @var Template $template */ /** @var Template $template */
...@@ -435,8 +436,9 @@ class MailTemplateService { ...@@ -435,8 +436,9 @@ class MailTemplateService {
$mail->setSendingTime($sendingTime); $mail->setSendingTime($sendingTime);
$mail->setReplyTo($this->replyToAddress); $mail->setReplyTo($this->replyToAddress);
$pageUid = (int) GeneralUtility::_GP('id');
$mail->setSiteRootId($this->replyToAddress); $siteRootId = BackendService::getSiteRoot($pageUid)['uid'];
$mail->setSiteRootId($siteRootId);
$mailRepository = $this->objectManager->get(MailRepository::class); $mailRepository = $this->objectManager->get(MailRepository::class);
$mailRepository->add($mail); $mailRepository->add($mail);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment