◆ __construct()
- Parameters
-
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory | $collectionFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Framework\Mail\Template\TransportBuilder | $transportBuilder | |
\Magento\Framework\Translate\Inline\StateInterface | $inlineTranslation | |
Definition at line 76 of file Observer.php.
83 $this->_scopeConfig = $scopeConfig;
84 $this->_collectionFactory = $collectionFactory;
86 $this->_transportBuilder = $transportBuilder;
◆ scheduledGenerateSitemaps()
scheduledGenerateSitemaps |
( |
| ) |
|
Generate sitemaps
- Returns
- void
- Exceptions
-
Definition at line 97 of file Observer.php.
102 if (!$this->_scopeConfig->isSetFlag(
103 self::XML_PATH_GENERATION_ENABLED,
115 $sitemap->generateXml();
116 }
catch (\Exception $e) {
121 if (
$errors && $this->_scopeConfig->getValue(
122 self::XML_PATH_ERROR_RECIPIENT,
126 $this->inlineTranslation->suspend();
128 $this->_transportBuilder->setTemplateIdentifier(
129 $this->_scopeConfig->getValue(
130 self::XML_PATH_ERROR_TEMPLATE,
133 )->setTemplateOptions(
135 'area' => \
Magento\Backend\
App\Area\FrontNameResolver::AREA_CODE,
139 [
'warnings' => join(
"\n",
$errors)]
141 $this->_scopeConfig->getValue(
142 self::XML_PATH_ERROR_IDENTITY,
146 $this->_scopeConfig->getValue(
147 self::XML_PATH_ERROR_RECIPIENT,
151 $transport = $this->_transportBuilder->getTransport();
152 $transport->sendMessage();
154 $this->inlineTranslation->resume();
◆ $_collectionFactory
◆ $_scopeConfig
◆ $_storeManager
◆ $_transportBuilder
◆ $inlineTranslation
◆ XML_PATH_CRON_EXPR
const XML_PATH_CRON_EXPR = 'crontab/default/jobs/generate_sitemaps/schedule/cron_expr' |
Cronjob expression configuration
- Deprecated:
- Use \Magento\Cron\Model\Config\Backend\Sitemap::CRON_STRING_PATH instead.
Definition at line 25 of file Observer.php.
◆ XML_PATH_ERROR_IDENTITY
const XML_PATH_ERROR_IDENTITY = 'sitemap/generate/error_email_identity' |
Error email identity configuration
Definition at line 35 of file Observer.php.
◆ XML_PATH_ERROR_RECIPIENT
const XML_PATH_ERROR_RECIPIENT = 'sitemap/generate/error_email' |
'Send error emails to' configuration
Definition at line 40 of file Observer.php.
◆ XML_PATH_ERROR_TEMPLATE
const XML_PATH_ERROR_TEMPLATE = 'sitemap/generate/error_email_template' |
Error email template configuration
Definition at line 30 of file Observer.php.
◆ XML_PATH_GENERATION_ENABLED
const XML_PATH_GENERATION_ENABLED = 'sitemap/generate/enabled' |
Enable/disable configuration
Definition at line 18 of file Observer.php.
The documentation for this class was generated from the following file: