<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Email; 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 TOCSm; pGtJR: $sEf_e->html = $ehntX; goto bFkaM; T9kEy: $sEf_e->option = $dKds6; goto GIO2N; NR8WP: $sEf_e->email = $CkJnt; goto Vi9hR; GIO2N: if ($c_YXM > 0) { $sEf_e->delay($c_YXM); } goto HH4Cu; TOCSm: self::checkConfig(); goto ibHpM; bFkaM: $sEf_e->emailUserName = $aPsJS; goto T9kEy; Vi9hR: $sEf_e->subject = $E4LhS; goto pGtJR; Kflq9: $sEf_e->type = 'html'; goto NR8WP; ibHpM: $sEf_e = new static(); goto Kflq9; HH4Cu: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($sEf_e); goto OqSrt; OqSrt: } 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 lfo1V; F8j3y: $sEf_e->emailUserName = $aPsJS; goto cjb8_; lfo1V: self::checkConfig(); goto Uu1vM; hZM74: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($sEf_e); goto gqxzm; OO3ps: $sEf_e->module = $X3Epx; goto AYGeq; sSoNa: $sEf_e->email = $CkJnt; goto D2XNA; AYGeq: if ($c_YXM > 0) { $sEf_e->delay($c_YXM); } goto hZM74; yHZcQ: $sEf_e->template = $jULgk; goto f59ea; cjb8_: $sEf_e->option = $dKds6; goto OO3ps; f59ea: $sEf_e->templateData = $DQ0aq; goto F8j3y; Uu1vM: $sEf_e = new static(); goto sSoNa; D2XNA: $sEf_e->subject = $E4LhS; goto yHZcQ; gqxzm: } public function handle() { goto cW7RW; M7XE2: Logger::info('Email', 'Start', $this->email . ' - ' . $this->subject . ' - ' . $this->template); goto bXwP_; opVbZ: BizException::throwsIfResponseError($oHb9_); goto cRkhv; kE9Wd: $oHb9_ = $dmHFN->send($this->email, $this->emailUserName, $this->subject, $ehntX); goto opVbZ; bXwP_: switch ($this->type) { case 'html': $ehntX = $this->html; break; default: goto EIsy7; dCVkz: 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 RmK30; RmK30: if (!view()->exists($vYMai)) { throw new \Exception('mail view not found : ' . $vYMai); } goto FofXi; FofXi: if (null === $this->emailUserName) { $this->emailUserName = $this->email; } goto axdnu; EIsy7: $vYMai = $this->template; goto dCVkz; Due7K: break; goto F5w3a; axdnu: $ehntX = View::make($vYMai, $this->templateData)->render(); goto Due7K; F5w3a: } goto Xa03m; cRkhv: Logger::info('Email', 'End', $this->email . ' - ' . $this->subject); goto N6lN1; Xa03m: BizException::throwsIfEmpty('MailSendJob.HtmlEmpty', $ehntX); goto kE9Wd; WhY2S: $dmHFN = MailSenderProvider::get($tcA2a); goto M7XE2; cW7RW: $tcA2a = app()->config->get('EmailSenderProvider'); goto WhY2S; N6lN1: } }