✏️ 正在编辑: Send.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/Modules/Mail/Notificador/Send.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php namespace Modules\Mail\Notificador; use Carbon\Carbon; use Modules\Mail\Enum\TipoEmail; use Modules\Callcenter\Dto\ReprocessamentoDto; class Send { /** @var string */ public const CSS = '/styles/email/notificador.min.css', LAYOUT = 'email/notificador.phtml' ; /** @var string */ public const TITLE = 'Informativo', REPROCESSAMENTO_TITLE = 'Reprocessamento de campanha', OPORTUNIDADES_TITLE = 'Novas oportunidades no seu Yuppie' ; /** @var string */ public const TEXTO_OPORTUNIDADES = 'Você possui <span class="destaque-texto">%s</span> ' . 'oportunidades novas em seu <span class="destaque-texto">Sistema Yuppie.</span>' . '<p>Acesse: <a href="%s">%s</a></p>'; /** @var string */ public const CAMPANHA_PERCENTUAL = 'A campanha <span class="destaque-texto">%s</span>' . ' atingiu <span class="destaque-texto">%s</span>,' . ' e teve um total de <span class="destaque-texto">%s</span> atendimentos resetados.'; /** @var string */ public const FOOTER = '<p>Esta mensagem foi enviada pelo Sistema Yuppie - ' . '<a href="http://www.yuppietech.com.br" target="_blank">www.yuppietech.com.br</a></p>'; /** * @param ReprocessamentoDto $dto * @throws \Zend_Mail_Exception */ public static function campanhaPercentual( ?string $campanha, ?float $percentual, ?int $resetados ) { $mail = new \Core_Mail(); $params = new \Core_View_Params(); $view = new \Zend_View(); $text = sprintf(self::CAMPANHA_PERCENTUAL, $campanha, $percentual . '%', $resetados); $view->setScriptPath(APPLICATION_PATH . '/views/scripts'); $mail->setDestinatarios(model('email-configuracao')->getEmailsNotificacaoCampanha()); $params->addParam('style', file_get_contents(publicPath(self::CSS)), false); $params->addParam('text', $text); $params->addParam('title', self::REPROCESSAMENTO_TITLE); $params->addParam('footer', self::getFooter()); $html = (new \Service_View())->render($view, self::LAYOUT, $params); $mail->newSend(self::REPROCESSAMENTO_TITLE, $html, TipoEmail::NOREPLY); } /** * @param \stdClass|null $corretor * @param int|null $oportunidades */ public static function sendEmailOportunidadesCorretor( ?\stdClass $corretor, ?int $oportunidades = 0 ) { $mail = new \Core_Mail(); $params = new \Core_View_Params(); $view = new \Zend_View(); $link = domain(); $view->setScriptPath(APPLICATION_PATH . '/views/scripts'); $mail->addDestinaraio($corretor->email); $params->addParam('style', file_get_contents(publicPath(self::CSS)), false); $params->addParam('text', sprintf(self::TEXTO_OPORTUNIDADES, $oportunidades, $link, $link)); $params->addParam('title', self::OPORTUNIDADES_TITLE); $params->addParam('footer', self::getFooter()); $html = (new \Service_View())->render($view, self::LAYOUT, $params); $mail->newSend(self::OPORTUNIDADES_TITLE, $html, TipoEmail::NOREPLY); } /** * @return string */ public static function getFooter(): string { return sprintf(self::FOOTER, Carbon::now()->format('d/m/Y H:i')); } }
💾 保存文件
← 返回文件管理器