Exemple #1
0
 /**
  * Get all receiver emails in an array
  *
  * @param string $receiverString String with some emails
  * @param int $feGroup fe_groups Uid
  * @return array
  */
 public static function getReceiverEmails($receiverString, $feGroup)
 {
     $array = self::getEmailsFromString($receiverString);
     if ($feGroup) {
         $array = array_merge($array, self::getEmailsFromFeGroup($feGroup));
     }
     if (ConfigurationUtility::getDevelopmentContextEmail()) {
         $array = [ConfigurationUtility::getDevelopmentContextEmail()];
     }
     return $array;
 }
 /**
  * Get HTML markup for development context Email
  *        if development context is active and
  *        development context email was set
  *
  * @param string $receiver overwrite regulare receiver email address
  * @return void
  */
 protected function getDevelopmentContextEmailMarkup(&$receiver)
 {
     if (!ConfigurationUtility::getDevelopmentContextEmail()) {
         return;
     }
     $originalReceiver = $receiver;
     $receiver = '<span style="color: red;"><strong>';
     $receiver .= ConfigurationUtility::getDevelopmentContextEmail();
     $receiver .= '</strong> &lt;Development context&gt;';
     $receiver .= '</span><br />';
     $receiver .= '<span style="color: #999;">' . $originalReceiver . '</span>';
 }
 /**
  * Get developmentcontext email
  *
  * @return  false|string
  */
 public function render()
 {
     return ConfigurationUtility::getDevelopmentContextEmail();
 }
 /**
  * Set receiver mails
  *
  * @return void
  */
 public function setReceiverEmails()
 {
     // get mails from FlexForm
     $emailArray = $this->getEmailsFromFlexForm();
     // get mails from fe_group
     if ((int) $this->settings['receiver']['type'] === 1 && !empty($this->settings['receiver']['fe_group'])) {
         $emailArray = $this->getEmailsFromFeGroup($this->settings['receiver']['fe_group']);
     }
     // get mails from predefined emailconfiguration
     if ((int) $this->settings['receiver']['type'] === 2 && !empty($this->settings['receiver']['predefinedemail'])) {
         $emailArray = $this->getEmailsFromPredefinedEmail($this->settings['receiver']['predefinedemail']);
     }
     // get mails from overwrite typoscript settings
     $overwriteReceivers = $this->overWriteEmailsWithTypoScript();
     if (!empty($overwriteReceivers)) {
         $emailArray = $overwriteReceivers;
     }
     // get mail from development context
     if (ConfigurationUtility::getDevelopmentContextEmail()) {
         $emailArray = [ConfigurationUtility::getDevelopmentContextEmail()];
     }
     // overwrite with a signal if needed
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__, [&$emailArray, $this]);
     $this->receiverEmails = $emailArray;
 }