Emails
2 months ago
Integrations
2 months ago
MultichannelMarketing
2 years ago
TransactionalEmails
10 months ago
WooCommerceBookings
1 month ago
WooCommerceSubscriptions
2 months ago
CouponPreProcessor.php
2 months ago
Emails.php
8 months ago
Helper.php
1 month ago
MailPoetTask.php
2 years ago
NonPersistablePreviewData.php
1 month ago
OrderAttributionFields.php
1 month ago
OrderAttributionRevenueReader.php
2 weeks ago
OrderAttributionWriter.php
1 month ago
RandomCouponCodeGenerator.php
2 months ago
Settings.php
1 year ago
SubscriberEngagement.php
3 years ago
Subscription.php
2 months ago
Tracker.php
2 years ago
TransactionalEmailHooks.php
1 year ago
TransactionalEmails.php
1 year ago
WooSystemInfo.php
1 month ago
WooSystemInfoController.php
1 year ago
index.php
3 years ago
WooSystemInfoController.php
80 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\WooCommerce; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Config\Renderer; |
| 9 | |
| 10 | class WooSystemInfoController { |
| 11 | |
| 12 | |
| 13 | /** @var WooSystemInfo */ |
| 14 | private $systemInfo; |
| 15 | |
| 16 | private $renderer; |
| 17 | |
| 18 | public function __construct( |
| 19 | WooSystemInfo $systemInfo, |
| 20 | Renderer $renderer |
| 21 | ) { |
| 22 | $this->systemInfo = $systemInfo; |
| 23 | $this->renderer = $renderer; |
| 24 | } |
| 25 | |
| 26 | public function render() { |
| 27 | |
| 28 | $output = $this->renderer->render('woo_system_info.html', [ |
| 29 | 'system_info' => $this->systemInfo->toArray(), |
| 30 | ]); |
| 31 | |
| 32 | // We are in control of the template and the data can be considered safe at this point |
| 33 | echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 34 | } |
| 35 | |
| 36 | public function addFields($response) { |
| 37 | $response->data['mailpoet'] = $this->systemInfo->toArray(); |
| 38 | return $response; |
| 39 | } |
| 40 | |
| 41 | public function addSchema($schema) { |
| 42 | $schema['mailpoet'] = [ |
| 43 | [ |
| 44 | 'description' => __('MailPoet', 'mailpoet'), |
| 45 | 'type' => 'object', |
| 46 | 'context' => ['view'], |
| 47 | 'readonly' => true, |
| 48 | 'properties' => [ |
| 49 | 'sending_method' => [ |
| 50 | 'description' => __('What method is used to sent out newsletters?', 'mailpoet'), |
| 51 | 'type' => 'boolean', |
| 52 | 'context' => ['view'], |
| 53 | 'readonly' => true, |
| 54 | ], |
| 55 | 'transactional_emails' => [ |
| 56 | 'description' => __('With which method are transactional emails sent?', 'mailpoet'), |
| 57 | 'type' => 'string', |
| 58 | 'context' => ['view'], |
| 59 | 'readonly' => true, |
| 60 | ], |
| 61 | 'task_scheduler_method' => [ |
| 62 | 'description' => __('What method controls the cron job?', 'mailpoet'), |
| 63 | 'type' => 'string', |
| 64 | 'context' => ['view'], |
| 65 | 'readonly' => true, |
| 66 | ], |
| 67 | 'cron_ping_url' => [ |
| 68 | 'description' => __('The URL which needs to be pinged to get the cron started?', 'mailpoet'), |
| 69 | 'type' => 'string', |
| 70 | 'context' => ['view'], |
| 71 | 'readonly' => true, |
| 72 | ], |
| 73 | ], |
| 74 | ], |
| 75 | ]; |
| 76 | |
| 77 | return $schema; |
| 78 | } |
| 79 | } |
| 80 |