✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/wordpress-popup/inc//hustle-mail.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
 * Hustle_Mail
 *
 * @package Hustle
 */

/**
 * Base class for sending emails.
 *
 * @since 3.0.5
 */
class Hustle_Mail {

	/**
	 * Email recipient
	 * The email address that will receive the mail
	 *
	 * @var string
	 */
	protected $recipient = '';

	/**
	 * Email message
	 *
	 * @var string
	 */
	protected $message = '';

	/**
	 * Email subject
	 *
	 * @var string
	 */
	protected $subject = '';

	/**
	 * Email 'from' address
	 *
	 * @var string
	 */
	protected $sender_email = '';

	/**
	 * Email 'from' name
	 *
	 * @var string
	 */
	protected $sender_name = '';

	/**
	 * Email headers
	 *
	 * @var array
	 */
	protected $headers = array();


	/**
	 * Main constructor
	 *
	 * @since 3.0.5
	 * @param string $recipient The email recipient.
	 * @param string $message The email message.
	 * @param string $subject The email subject.
	 */
	public function __construct( $recipient = '', $message = '', $subject = '' ) {
		$this->set_recipient( $recipient );
		$this->set_message( $message );
		if ( ! empty( $subject ) ) {
			$this->subject = $subject;
		}

		$this->set_sender();
		$this->set_headers();
	}

	/**
	 * Set recipient
	 *
	 * @since 3.0.5
	 * @param string $recipient The email recipient.
	 */
	private function set_recipient( $recipient ) {
		if ( empty( $recipient ) ) {
			return;
		}
		$recipients = array_map( 'trim', explode( ',', $recipient ) );
		if ( empty( $recipients ) ) {
			return;
		}
		$emails = array();
		foreach ( $recipients as $email ) {
			$filtered_email = filter_var( $email, FILTER_VALIDATE_EMAIL );
			if ( $filtered_email ) {
				$emails[] = $filtered_email;
			}
		}
		if ( empty( $emails ) ) {
			return;
		}

		$this->recipient = $emails;
	}

	/**
	 * Set message
	 *
	 * @since 3.0.5
	 * @param string $message The email message.
	 */
	private function set_message( $message ) {
		if ( ! empty( $message ) ) {
			$this->message = $message;
		}
	}

	/**
	 * Set headers.
	 *
	 * @since 3.0.5
	 * @param array $headers The email headers.
	 */
	public function set_headers( $headers = array() ) {
		if ( ! empty( $headers ) ) {
			$this->headers = $headers;

		} else {

			$this->headers   = array(
				'From: ' . $this->sender_name . ' <' . $this->sender_email . '>',
			);
			$this->headers[] = 'Content-Type: text/html; charset=UTF-8';
		}
	}

	/**
	 * Set sender details.
	 *
	 * @since 3.0.5
	 */
	private function set_sender() {
		$general_settings   = Hustle_Settings_Admin::get_general_settings();
		$this->sender_email = $general_settings['sender_email_address'];
		$this->sender_name  = $general_settings['sender_email_name'];
	}

	/**
	 * Clean mail variables
	 *
	 * @since 3.0.5
	 */
	private function clean() {
		$subject       = stripslashes( $this->subject );
		$subject       = wp_strip_all_tags( $subject );
		$this->subject = $subject;

		$message       = stripslashes( $this->message );
		$message       = wpautop( $message );
		$message       = make_clickable( $message );
		$this->message = $message;
	}

	/**
	 * Send mail
	 *
	 * @since 3.0.5
	 * @return bool
	 */
	public function send() {
		$sent = false;
		if ( ! empty( $this->recipient ) && ! empty( $this->subject ) && ! empty( $this->message ) ) {
			$this->clean();
			foreach ( $this->recipient as $to ) {
				$sent = wp_mail( $to, $this->subject, $this->message, $this->headers );
			}
		}
		return $sent;
	}

	/**
	 * Send the actual email.
	 *
	 * @since 3.0.5
	 * @return bool
	 */
	public function process_mail() {
		return $this->send();
	}

	/**
	 * Does the process to submit the unsubscription email.
	 *
	 * @since 3.0.5
	 * @param string $email Email to be unsubscribed.
	 * @param array  $modules_id IDs of the modules to which it will be unsubscribed.
	 * @param string $referer URL referer.
	 * @return boolean
	 */
	public static function handle_unsubscription_user_email( $email, $modules_id, $referer ) {
		if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
			Opt_In_Utils::maybe_log( __METHOD__, 'The provided email address is not valid.' );
			return false;
		}

		if ( ! filter_var( $referer, FILTER_VALIDATE_URL ) ) {
			Opt_In_Utils::maybe_log( __METHOD__, 'The provided referer is not valid.' );
			return false;
		}

		$email           = apply_filters( 'hustle_unsubscribe_email_recipient', $email, $modules_id, $referer );
		$unsubscribe_url = self::get_unsubscribe_link( $email, $modules_id, $referer );
		if ( ! $unsubscribe_url ) {
			Opt_In_Utils::maybe_log( __METHOD__, 'There was an error getting the nonce.' );
			return false;
		}
		$email_settings = Hustle_Settings_Admin::get_unsubscribe_email_settings();
		$message        = str_replace( '{hustle_unsubscribe_link}', $unsubscribe_url, $email_settings['email_body'] );
		$message        = apply_filters( 'hustle_unsubscribe_email_message', $message, $unsubscribe_url, $email, $modules_id, $referer );

		$email_handler = new self( $email, $message, $email_settings['email_subject'] );
		$sent          = $email_handler->process_mail();

		return $sent;
	}

	/**
	 * Get Unsubscribe link
	 *
	 * @param string $email Email.
	 * @param array  $modules_id Module IDs unsubscribe from.
	 * @param string $referer Unsubscription base URL.
	 * @return string
	 */
	public static function get_unsubscribe_link( $email, $modules_id, $referer = '' ) {
		if ( ! $referer ) {
			$referer = get_option( 'hustle_unsubscribe_page' );
		}
		if ( ! $referer ) {
			return '';
		}
		$module = Hustle_Module_Model::new_instance();
		$nonce  = $module->create_unsubscribe_nonce( $email, $modules_id );
		if ( ! $nonce ) {
			return '';
		}

		$parsed_url      = wp_parse_url( $referer, PHP_URL_QUERY );
		$concatenate     = empty( $parsed_url ) ? '?' : '&';
		$unsubscribe_url = apply_filters(
			'hustle_unsubscribe_email_url',
			$referer . $concatenate . 'token=' . $nonce . '&email=' . rawurlencode( $email ),
			$email,
			$modules_id,
			$referer
		);

		return $unsubscribe_url;
	}

	/**
	 * Static function to send an email.
	 *
	 * @since 3.0.5
	 * @param string $to Email recipient.
	 * @param string $subject Email subject.
	 * @param string $body Email body.
	 * @return bool
	 */
	public static function send_email( $to, $subject, $body ) {
		$email_handler = new self( $to, $body, $subject );
		$sent          = $email_handler->process_mail();

		return $sent;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
display-conditions
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
front
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
helpers
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
metas
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
multisite
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
palettes
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
provider
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
providers
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
templates
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
update
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
class-hustle-admin-page-abstract.php
17.655 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-auth-token.php
2.666 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-hustle-condition-factory.php
0.964 KB
26 May 2020 3.58 PM
builxejc / builxejc
0644
class-hustle-cross-sell.php
1.597 KB
15 Sep 2025 10.29 AM
builxejc / builxejc
0644
class-hustle-dashboard-admin.php
15.469 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-data.php
3.123 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-db.php
8.669 KB
12 Oct 2023 2.01 PM
builxejc / builxejc
0644
class-hustle-installer.php
1.258 KB
3 Jan 2022 12.51 PM
builxejc / builxejc
0644
class-hustle-meta.php
1.9 KB
6 Apr 2023 4.20 PM
builxejc / builxejc
0644
class-hustle-module-admin.php
9.39 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-module-collection.php
12.108 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-hustle-module-fields.php
0.436 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
class-hustle-module-page-abstract.php
43.598 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-module-validator.php
2.074 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
class-hustle-notifications.php
29.269 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-settings-admin.php
16.863 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-wp-dashboard-page.php
16.575 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-opt-in.php
2.35 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-background-conversion-log.php
2.701 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
hustle-deletion.php
7.746 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
hustle-embedded-admin.php
0.712 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-entries-admin.php
29.812 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-entry-model.php
32.216 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-general-data-protection.php
11.44 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-init.php
1.382 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-mail.php
6.206 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-migration.php
55.115 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-model.php
34.073 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-module-model.php
30.92 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-module-widget-legacy.php
4.953 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-module-widget.php
3.903 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-modules-common-admin-ajax.php
32.168 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-popup-admin.php
0.639 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-providers-admin.php
6.822 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-providers.php
16.267 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-settings-admin-ajax.php
24.727 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-settings-page.php
5.03 KB
17 Apr 2023 3.18 PM
builxejc / builxejc
0644
hustle-slidein-admin.php
0.651 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-sshare-admin.php
2.503 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-sshare-model.php
21.675 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-tracking-model.php
25.706 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
interface-hustle-auth-provider.php
0.509 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
opt-in-geo.php
13.099 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
opt-in-utils.php
41.588 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
opt-in-wpmudev-api.php
3.985 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF