public function __construct(NewsletterInterface $newsletter, SendSettingsInterface $sendSettings)
 {
     parent::__construct();
     $this->setSubject($newsletter->getSubject());
     $this->setSenderName($newsletter->getSenderName());
     $this->setSenderMail($newsletter->getSenderMail());
     $this->setReturnMail($newsletter->getReturnMail());
     $this->setUsername($sendSettings->getUsername());
     $this->setPassword($sendSettings->getPassword());
     $this->setHost($sendSettings->getHost());
     $this->setPort($sendSettings->getPort());
     $this->setEncryption($sendSettings->getEncryption());
     $this->setAuthMode($sendSettings->getAuthMode());
     $this->setScheduled($sendSettings->getStarttime());
     $this->setNewsletterId($newsletter->getId());
     $this->salt = $newsletter->getMandant()->getSalt();
 }
 /**
  * @param SendSettings $sendSettings
  */
 protected function setSendSettings(SendSettingsInterface $sendSettings = null)
 {
     $newsletter = $this->getNewsletter();
     if ($sendSettings !== null) {
         $plainpassword = $sendSettings->getPassword();
         $sendSettings->setPassword($this->encryptPassword($plainpassword));
         // clone sendSetting if newsletter has none assigned
         // in order to always get a different one from the mandant
         if ($newsletter->getSendSettings() === null) {
             $sendSettings = clone $sendSettings;
         }
     }
     $newsletter->setSendSettings($sendSettings);
     $mandantName = $this->getMandantName();
     $this->getMandantManager()->persistNewsletter($mandantName, $newsletter);
     return $this;
 }