MagePal\GmailSmtpApp\Helper\Data::getConfigSetReplyTo PHP Method

getConfigSetReplyTo() public method

Get system config reply to
public getConfigSetReplyTo ( $store_id = null ) : boolean
return boolean
    public function getConfigSetReplyTo($store_id = null)
    {
        return $this->scopeConfig->getValue('system/gmailsmtpapp/set_reply_to', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store_id);
    }

Usage Example

 /**
  * @param \Magento\Framework\Mail\MessageInterface $message
  * @param \MagePal\GmailSmtpApp\Helper\Data $dataHelper
  * @throws \Zend_Mail_Exception
  */
 public function __construct(\Magento\Framework\Mail\MessageInterface $message, \MagePal\GmailSmtpApp\Helper\Data $dataHelper)
 {
     if (!$message instanceof \Zend_Mail) {
         throw new \InvalidArgumentException('The message should be an instance of \\Zend_Mail');
     }
     //Set reply-to path
     $setReturnPath = $dataHelper->getConfigSetReturnPath();
     switch ($setReturnPath) {
         case 1:
             $returnPathEmail = $message->getFrom();
             break;
         case 2:
             $returnPathEmail = $dataHelper->getConfigReturnPathEmail();
             break;
         default:
             $returnPathEmail = null;
             break;
     }
     if ($returnPathEmail !== null && $dataHelper->getConfigSetReturnPath()) {
         $message->setReturnPath($returnPathEmail);
     }
     if ($message->getReplyTo() === NULL && $dataHelper->getConfigSetReplyTo()) {
         $message->setReplyTo($returnPathEmail);
     }
     //set config
     $smtpConf = ['auth' => strtolower($dataHelper->getConfigAuth()), 'ssl' => $dataHelper->getConfigSsl(), 'username' => $dataHelper->getConfigUsername(), 'password' => $dataHelper->getConfigPassword(), 'port' => $dataHelper->getConfigSmtpPort()];
     $smtpHost = $dataHelper->getConfigSmtpHost();
     parent::__construct($smtpHost, $smtpConf);
     $this->_message = $message;
 }