Current path: home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin/Handlers/
?? Go up: /home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin
<?php
namespace KS_PAC_DCFH\Admin\Handlers;
if (!defined('ABSPATH')) {
exit;
}
class MailHandler
{
private static $_instance;
public static function instance(): self
{
if (self::$_instance === null) {
self::$_instance = new self();
}
return self::$_instance;
}
public function set_mail_content_type_html(string $content_type = 'text/html'): void
{
add_filter('wp_mail_content_type', static function () use ($content_type) {
return $content_type;
});
}
public function set_mail_from(string $custom_mail_from = ''): void
{
if (!empty($custom_mail_from)) {
add_filter('wp_mail_from', static function ($from_email) use ($custom_mail_from) {
return $custom_mail_from;
});
}
}
public function set_mail_from_name(string $custom_mail_from_name = ''): void
{
if (!empty($custom_mail_from_name)) {
add_filter('wp_mail_from_name', static function ($from_name) use ($custom_mail_from_name) {
return $custom_mail_from_name;
});
}
}
}