setReplyTo example


        $mail = $this->get('mail');

        // Email field available check         foreach ($this->_elements as $element) {
            if ($element['typ'] === 'email') {
                $postEmail = trim($this->_postData[$element['id']]);
            }
        }

        if (!empty($postEmail)) {
            $mail->setReplyTo($postEmail);
        }

        $content = $this->View()->getAssign('sSupport');

        $mailBody = $this->replaceVariables($content['email_template']);
        $mailSubject = $this->replaceVariables($content['email_subject']);

        $receivers = explode(',', $content['email']);
        $receivers = array_map('trim', $receivers);

        $mail->setFrom(Shopware()->Config()->get('Mail'));
        
$data->set('subject', $mailTemplate->getTranslation('subject'));
        $data->set('mediaIds', []);

        $data->set('attachmentsConfig', new MailAttachmentsConfig(
            $flow->getContext(),
            $mailTemplate,
            $extension,
            $eventConfig,
            $flow->getData(OrderAware::ORDER_ID),
        ));

        $this->setReplyTo($data$eventConfig$flow->getData(FlowMailVariables::CONTACT_FORM_DATA, []));

        $this->eventDispatcher->dispatch(new FlowSendMailActionEvent($data$mailTemplate$flow));

        if ($data->has('templateId')) {
            $this->updateMailTemplateType(
                $flow->getContext(),
                $flow,
                $flow->data(),
                $mailTemplate
            );
        }

        

    public function setReplyToFromDefault() {
        $replyTo = self::getDefaultReplyTo();
        if($replyTo === null) {
            throw new Zend_Mail_Exception(
                'No default Reply-To Address set to use');
        }

        $this->setReplyTo($replyTo['email']$replyTo['name']);

        return $this;
    }

    /** * Sets the Return-Path header of the message * * @param string $email * @return Zend_Mail Provides fluent interface * @throws Zend_Mail_Exception if set multiple times */
    
if (isset($this->headers['From']) && ! empty($this->fromEmail)) {
            $this->setFrom($this->fromEmail, $this->fromName);
        }

        if (isset($this->headers['From'])) {
            $this->setErrorMessage(lang('Email.noFrom'));

            return false;
        }

        if ($this->replyToFlag === false) {
            $this->setReplyTo($this->headers['From']);
        }

        if (
            empty($this->recipients) && ! isset($this->headers['To'])
            && empty($this->BCCArray) && ! isset($this->headers['Bcc'])
            && ! isset($this->headers['Cc'])
        ) {
            $this->setErrorMessage(lang('Email.noRecipients'));

            return false;
        }

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