✏️ 正在编辑: Notificacao.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/application/services/Corretor/Notificacao.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Service_Corretor_Notificacao { /** @var string */ public const EMAIL_YUPPIE = 'no-reply@yuppietech.com.br', PHTML_NOTIFICACAO_GERENTE = 'gerente-rota/notificacao-cadastro.phtml', TITULO_NOTIFICACAO_GERENTE = 'Novo parceiro cadastrado' ; public static function notificarGerente(int $corretorId): void { $gerente = (new Model_Corretor())->getGerenteRota($corretorId); if (empty($gerente)) { return; } self::whatsappNotificacaoGerente($gerente); self::emailNotificacaoGerente($gerente); } public static function emailNotificacaoGerente($gerente): void { if (empty($gerente['email'])) { return; } $mail = new Core_Mail(); $view = new Zend_View; $view->gerente = $gerente; $view->corretor = $gerente['corretor_nome']; $view->setScriptPath(APPLICATION_PATH . '/views/scripts'); $mail->addDestinaraio($gerente['email']); $mail->newSend( self::TITULO_NOTIFICACAO_GERENTE, $view->render(self::PHTML_NOTIFICACAO_GERENTE), self::EMAIL_YUPPIE ); } public static function whatsappNotificacaoGerente($gerente): void { $celular = $gerente['celular']; if (empty($celular)) { $celular = $gerente['fone']; } if (empty($celular)) { return; } if (!$whatsapp = \Core_Whatsapp_Factory::load()) { return; } $mensagem = "Olá {$gerente['nome']}! \n" . "Informamos que o parceiro {$gerente['corretor_nome']} se cadastrou com sucesso *Sistema Yuppie*. \n" . "Ele já recebeu uma mensagem de boas-vindas com login e senha de acesso a área do parceiro. \n\n" . "Porém, só poderá acessar quando o seu cadastro for aprovado. \n" . "A direção.\n\n\n" . "_Esta mensagem foi enviada pelo Sistema Yuppie_"; $whatsapp->sendMessage(String_Refatorar::formatarTelefone($celular), $mensagem); } }
💾 保存文件
← 返回文件管理器