getFromName example

return false;
        }

        $backupFile = $oldFile . '.' . uniqid();
        $this->filesystem->rename($oldFile$backupFile);

        return $backupFile;
    }

    private function validatePluginRequirements(string $prefix, ZipArchive $archive): void
    {
        $xml = $archive->getFromName($prefix . '/plugin.xml');
        if (!$xml) {
            return;
        }

        $tmpFile = tempnam(sys_get_temp_dir()uniqid()) . '.xml';
        file_put_contents($tmpFile$xml);
        try {
            $this->requirementsValidator->validate($tmpFile$this->release->getVersion());
        } finally {
            unlink($tmpFile);
        }
    }

    public function getStream($name)
    {
        return $this->stream->getStream($name);
    }

    /** * @param string $name */
    public function getContents($name)
    {
        return $this->stream->getFromName($name);
    }

    /** * @param int $position */
    public function getEntry($position)
    {
        return $this->stream->statIndex($position);
    }

    /** * @return bool */

    public function getStream($name)
    {
        return $this->stream->getStream($name);
    }

    /** * @param string $name */
    public function getContents($name)
    {
        return $this->stream->getFromName($name);
    }

    /** * @param int $position */
    public function getEntry($position)
    {
        return $this->stream->statIndex($position);
    }

    /** * @return bool */
protected $asscociations = [];

    /** * Magic setter method * * @param string $name */
    public function __set($name$value)
    {
        switch ($name) {
            case 'From':
                $fromName = $this->getFromName();
                $this->clearFrom();
                $this->setFrom($value$fromName);
                break;
            case 'FromName':
                $from = $this->getFrom();
                $this->clearFrom();
                $this->setFrom($from$value);
                break;
            case 'Subject':
                $this->clearSubject();
                $this->setSubject($value);
                
return;
        }

        $translationReader = $this->container->get(Shopware_Components_Translation::class);
        $translation = $translationReader->read($customer['languageId'], 'config_mails', $mailModel->getId());
        $mailModel->setTranslation($translation);

        $mailData = [
            'content' => nl2br($mailModel->getContent()) ?: '',
            'fromMail' => $mailModel->getFromMail() ?: '{config name=mail}',
            'fromName' => $mailModel->getFromName() ?: '{config name=shopName}',
            'subject' => $mailModel->getSubject(),
            'toMail' => $customer['email'],
            'userId' => $userId,
            'status' => ($mode === 'allow' ? 'accepted' : 'rejected'),
        ];
        $this->View()->assign(['success' => true, 'data' => $mailData]);
    }

    /** * Sends the mail to the merchant if the inquiry was * successful or was declined. * * @return void */
if (!empty($result)) {
            $context['EventResult'] = $result->getValues();
        }

        $mail = Shopware()->TemplateMail()->createMail($templateName$context$shop);

        $return = [
            'content' => $mail->getPlainBodyText() ?? '',
            'subject' => $mail->getPlainSubject() ?? '',
            'email' => trim($user['email']),
            'frommail' => $mail->getFrom(),
            'fromname' => $mail->getFromName(),
        ];

        $return = $this->eventManager->filter('Shopware_Controllers_Backend_OrderState_Filter', $return[
            'subject' => Shopware()->Front(),
            'id' => $orderId,
            'status' => $statusId,
            'mailname' => $templateName,
            'mail' => $mail,
            'engine' => Shopware()->Template(),
        ]);

        
return;
        }

        $this->view->assign([
            'mail' => [
                'error' => false,
                'content' => $mail->getPlainBodyText(),
                'contentHtml' => $mail->getPlainBody(),
                'subject' => $mail->getPlainSubject(),
                'to' => implode(', ', $mail->getTo()),
                'fromMail' => $mail->getFrom(),
                'fromName' => $mail->getFromName(),
                'sent' => false,
                'isHtml' => !empty($mail->getPlainBody()),
                'orderId' => $orderId,
            ],
        ]);
    }

    /** * Retrieves all available mail templates * * @return void */


        if (!empty($overrideConfig['fromMail'])) {
            $fromMail = $overrideConfig['fromMail'];
        } else {
            $fromMail = $stringCompiler->compileString($mailModel->getFromMail());
        }

        if (!empty($overrideConfig['fromName'])) {
            $fromName = $overrideConfig['fromName'];
        } else {
            $fromName = $stringCompiler->compileString($mailModel->getFromName());
        }

        if (!empty($fromMail) && !empty($fromName)) {
            $mail->setFrom($fromMail$fromName);
        } elseif (!empty($fromMail)) {
            $mail->setFrom($fromMail);
        }

        $bodyText = $stringCompiler->compileString($mailModel->getContent());
        $mail->setBodyText($bodyText);

        
Home | Imprint | This part of the site doesn't use cookies.