REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.49 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Cron/Workers/SendingQueue/Tasks/Mailer.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Cron\Workers\SendingQueue\Tasks; if (!defined('ABSPATH')) exit; use MailPoet\Mailer\Mailer as MailerInstance; use MailPoet\Mailer\MailerFactory; use MailPoet\Mailer\MailerLog; use MailPoet\Mailer\Methods\MailPoet; class Mailer { /** @var MailerFactory */ private $mailerFactory; /** @var MailerInstance */ private $mailer; public function __construct( MailerFactory $mailerFactory ) { $this->mailerFactory = $mailerFactory; $this->mailer = $this->configureMailer(); } public function configureMailer($newsletter = null) { $sender['address'] = (!empty($newsletter->senderAddress)) ? $newsletter->senderAddress : null; $sender['name'] = (!empty($newsletter->senderName)) ? $newsletter->senderName : null; $replyTo['address'] = (!empty($newsletter->replyToAddress)) ? $newsletter->replyToAddress : null; $replyTo['name'] = (!empty($newsletter->replyToName)) ? $newsletter->replyToName : null; if (!$sender['address']) { $sender = null; } if (!$replyTo['address']) { $replyTo = null; } $this->mailer = $this->mailerFactory->buildMailer(null, $sender, $replyTo); return $this->mailer; } public function getMailerLog() { return MailerLog::getMailerLog(); } public function updateSentCount() { return MailerLog::incrementSentCount(); } public function getProcessingMethod() { return ($this->mailer->mailerMethod instanceof MailPoet) ? 'bulk' : 'individual'; } public function prepareSubscriberForSending($subscriber) { return $this->mailer->formatSubscriberNameAndEmailAddress($subscriber); } public function sendBulk($preparedNewsletters, $preparedSubscribers, $extraParams = []) { if ($this->getProcessingMethod() === 'individual') { throw new \LogicException('Trying to send a batch with individual processing method'); } return $this->mailer->mailerMethod->send( $preparedNewsletters, $preparedSubscribers, $extraParams ); } public function send($preparedNewsletter, $preparedSubscriber, $extraParams = []) { if ($this->getProcessingMethod() === 'bulk') { throw new \LogicException('Trying to send an individual email with a bulk processing method'); } return $this->mailer->mailerMethod->send( $preparedNewsletter, $preparedSubscriber, $extraParams ); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Links.php
3.50 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Mailer.php
2.49 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Newsletter.php
12.23 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Posts.php
2.41 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Shortcodes.php
1.44 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).