<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Job; use Illuminate\Support\Facades\View; use ModStart\Core\Exception\BizException; use ModStart\Core\Job\BaseJob; use Module\Vendor\Log\Logger; use Module\Vendor\Provider\MailSender\AbstractMailSenderProvider; use Module\Vendor\Provider\MailSender\MailSenderProvider; class MailSendJob extends BaseJob { public $email; public $subject; public $template; public $templateData = array(); public $emailUserName = null; public $option = array(); public $module; public $html; public $type; private static function checkConfig() { $tcA2a = app()->config->get('EmailSenderProvider'); BizException::throwsIfEmpty('邮箱发送未设置', $tcA2a); } public static function createHtml($CkJnt, $E4LhS, $ehntX, $aPsJS = null, $dKds6 = array(), $c_YXM = 0) { goto GGu7q; FRM60: $sEf_e = new static(); goto UBg04; Im4wv: $sEf_e->emailUserName = $aPsJS; goto NpTS8; UBg04: $sEf_e->type = 'html'; goto RhbgL; RhbgL: $sEf_e->email = $CkJnt; goto wZTZ_; pD0rg: $sEf_e->html = $ehntX; goto Im4wv; h2lKp: if ($c_YXM > 0) { $sEf_e->delay($c_YXM); } goto SCiOI; NpTS8: $sEf_e->option = $dKds6; goto h2lKp; GGu7q: self::checkConfig(); goto FRM60; wZTZ_: $sEf_e->subject = $E4LhS; goto pD0rg; SCiOI: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($sEf_e); goto QPZnn; QPZnn: } public static function createModule($X3Epx, $jULgk, $CkJnt, $E4LhS, $DQ0aq = array(), $aPsJS = null, $dKds6 = array(), $c_YXM = 0) { self::create($CkJnt, $E4LhS, $jULgk, $DQ0aq, $aPsJS, $dKds6, $c_YXM, $X3Epx); } public static function create($CkJnt, $E4LhS, $jULgk, $DQ0aq = array(), $aPsJS = null, $dKds6 = array(), $c_YXM = 0, $X3Epx = null) { goto F4bST; tVdUa: $sEf_e->module = $X3Epx; goto yeSTp; fsdFu: $sEf_e->option = $dKds6; goto tVdUa; IMNSB: $sEf_e->email = $CkJnt; goto qVolL; r5KMl: $sEf_e->templateData = $DQ0aq; goto hl_Oh; qVolL: $sEf_e->subject = $E4LhS; goto pkD8a; yeSTp: if ($c_YXM > 0) { $sEf_e->delay($c_YXM); } goto Z1tEN; ST0mu: $sEf_e = new static(); goto IMNSB; F4bST: self::checkConfig(); goto ST0mu; Z1tEN: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($sEf_e); goto EJvb5; pkD8a: $sEf_e->template = $jULgk; goto r5KMl; hl_Oh: $sEf_e->emailUserName = $aPsJS; goto fsdFu; EJvb5: } public function handle() { goto HDGJh; KkM_z: switch ($this->type) { case 'html': $ehntX = $this->html; break; default: goto fvqXl; acQYz: break; goto xFUZx; HcgoX: if (null === $this->emailUserName) { $this->emailUserName = $this->email; } goto zdzwE; zdzwE: $ehntX = View::make($vYMai, $this->templateData)->render(); goto acQYz; hwGK3: if (!view()->exists($vYMai)) { throw new \Exception('mail view not found : ' . $vYMai); } goto HcgoX; fvqXl: $vYMai = $this->template; goto yc2rN; yc2rN: if (!view()->exists($vYMai)) { $vYMai = 'theme.' . modstart_config()->getWithEnv('siteTemplate', 'default') . '.mail.' . $this->template; if (!view()->exists($vYMai)) { $vYMai = 'theme.default.mail.' . $this->template; if (!view()->exists($vYMai)) { if ($this->module) { $vYMai = 'module::' . $this->module . '.View.mail.' . $this->template; } if (!view()->exists($vYMai)) { $vYMai = 'module::Vendor.View.mail.' . $this->template; } } } } goto hwGK3; xFUZx: } goto gXMbP; O0rtP: $oHb9_ = $dmHFN->send($this->email, $this->emailUserName, $this->subject, $ehntX); goto gdSNl; HDGJh: $tcA2a = app()->config->get('EmailSenderProvider'); goto XWjzZ; VwMnG: Logger::info('Email', 'End', $this->email . ' - ' . $this->subject); goto iaxT_; d2uN3: Logger::info('Email', 'Start', $this->email . ' - ' . $this->subject . ' - ' . $this->template); goto KkM_z; XWjzZ: $dmHFN = MailSenderProvider::get($tcA2a); goto d2uN3; gXMbP: BizException::throwsIfEmpty('MailSendJob.HtmlEmpty', $ehntX); goto O0rtP; gdSNl: BizException::throwsIfResponseError($oHb9_); goto VwMnG; iaxT_: } }