当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::find方法代码示例

本文整理汇总了PHP中Email::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::find方法的具体用法?PHP Email::find怎么用?PHP Email::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Email的用法示例。


在下文中一共展示了Email::find方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($hashId)
 {
     $id = \Jamesy\Miscellaneous::decryptId($hashId);
     if ($email = Email::find($id)) {
     }
     return View::make('backend.emails.send_templates.main', ['email_body' => $email->email_body]);
 }
开发者ID:shinichi81,项目名称:Nifty-Newsletter,代码行数:7,代码来源:SentEmailCustomController.php

示例2: destroy

 public function destroy($id)
 {
     if ($email = Email::find($id)) {
         $email->is_deleted = 1;
         $email->save();
         return Response::json(['message' => 'Email deleted']);
     } else {
         return Response::json(['flash' => 'Server error'], 500);
     }
 }
开发者ID:shinichi81,项目名称:Nifty-Newsletter,代码行数:10,代码来源:SentEmailResourceController.php

示例3: cadastroEmpresa

 public function cadastroEmpresa()
 {
     try {
         $_POST = Utils::sanitazeArray($_POST);
         $rg = NULL;
         $tipoPessoa = $_POST[$this->Pessoa->name]['tipo_pessoa'];
         $nome = $_POST[$this->Pessoa->name]['nome'];
         $email = $_POST[$this->Pessoa->name]['email'];
         $razao = $_POST['Juridica']['razao'];
         $fantasia = $_POST['Juridica']['fantasia'];
         $ie = $_POST['Juridica']['ie'];
         $senha = Authentication::password($_POST[$this->Pessoa->name]['senha']);
         if ($tipoPessoa == 1) {
             $cpfCnpj = Utils::returnNumeric($_POST['Fisica']['cpf']);
             $_POST[$this->Pessoa->name]['cpf'] = Utils::returnNumeric($_POST['Fisica']['cpf']);
         } else {
             $this->Pessoa->validate = $this->Pessoa->validate_fisica;
             $cpfCnpj = Utils::returnNumeric($_POST['Juridica']['cnpj']);
             $_POST[$this->Pessoa->name]['cnpj'] = Utils::returnNumeric($_POST['Juridica']['cnpj']);
             $_POST[$this->Pessoa->name]['razao'] = $_POST['Juridica']['razao'];
             $_POST[$this->Pessoa->name]['fantasia'] = $_POST['Juridica']['fantasia'];
             $_POST[$this->Pessoa->name]['ie'] = $_POST['Juridica']['ie'];
         }
         $this->Pessoa->data = $_POST[$this->Pessoa->name];
         if ($this->Pessoa->validates()) {
             $retorno = $this->Pessoa->cadastroEmpresa($nome, $cpfCnpj, $rg, $razao, $fantasia, $ie, $email, $senha, $tipoPessoa);
             if (isset($retorno['pessoaId']) && $retorno['pessoaId'] > 0) {
                 //enviar email
                 #recupero a chave do usuario
                 $chave = $this->Pessoa->recuperaChave($cpfCnpj);
                 #recupero o corpo do meu email para ser cadastrado
                 $email = new Email();
                 $registro = $email->find('first', array('tag' => 'cadastro_sucesso'));
                 #faço a troca de siglas para personalizar o email
                 $array = array('__NOME_REMETENTE__' => $_POST[$this->Pessoa->name]['nome'], '__DATE__' => date('d/m/Y h:i:s'), '__URL__' => Router::url(array('Pages', 'ativarConta', $chave)));
                 #envio o email de confirmação para o meu cliente cadastrado
                 $objeto = new MailPHPMailer();
                 $objeto->setAssunto('Cadastro realizado com sucesso!');
                 $objeto->setRemetente();
                 $objeto->setDestinatario($_POST[$this->Pessoa->name]['email'], $_POST[$this->Pessoa->name]['nome']);
                 $objeto->setBody(str_replace(array_keys($array), array_values($array), $registro[0]['Email']['corpo_mail']));
                 $email = $objeto->sendMail();
                 #saida para o usuario
                 echo json_encode(array('erro' => false, 'mensagem' => "Seu cadastro foi efetuado com sucesso", 'pessoa_id' => (int) $retorno['pessoaId'], 'envio_email' => $email));
             } else {
                 #caso de erro fazer esse procedimento
             }
         } else {
             echo json_encode(array('erro' => true, 'erros' => $this->Pessoa->validateErros));
         }
     } catch (Exception $ex) {
         #em caso de erro fazer esse procedimento
         echo json_encode(array('erro' => true, 'erros' => utf8_encode($ex->getMessage())));
     }
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:55,代码来源:WebservicesController.php

示例4: actionTracking

 public function actionTracking($id)
 {
     header('Content-Type: image/jpg');
     if ($email = Email::find($id)) {
         $email->views++;
         $email->save();
     }
     $graphic_http = "http://{$_SERVER['HTTP_HOST']}/blank.jpg";
     $filesize = filesize('blank.jpg');
     header('Pragma: public');
     header('Expires: 0');
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Cache-Control: private', false);
     header('Content-Disposition: attachment; filename="blank.jpg"');
     header('Content-Transfer-Encoding: binary');
     header('Content-Length: ' . $filesize);
     readfile($graphic_http);
     exit;
 }
开发者ID:strepan,项目名称:test,代码行数:19,代码来源:HomeController.php

示例5: agendadosEmail

 public function agendadosEmail()
 {
     try {
         $agendados = $this->Cron->situacaoAgendadaEmail();
         $email = new Email();
         $email_body = $email->find('first', array('tag' => 'cron_email'));
         if (count($agendados) > 0) {
             foreach ($agendados as $registro) {
                 #condição para enviar emails
                 if ($registro['email'] != null || $registro['email'] != '') {
                     $this->eviarEmail($email_body, $registro);
                 }
             }
         }
         echo '<pre>';
         print_r($agendados);
     } catch (Exception $ex) {
         echo $ex->getMessage();
     }
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:20,代码来源:CronsController.php

示例6: envioEmail

 public function envioEmail()
 {
     try {
         $this->layout = 'null';
         $token = $_GET['param'];
         $reserva = $this->Reserva->find('first', array('token' => $token));
         $reserva = array_shift($reserva);
         /**
          * recupero o salão e ambiente da reserva
          */
         $dadoEmailReserva = $this->Reserva->recuperaDadosReservaEmail($reserva['Reserva']['id']);
         $cliente = $this->Cliente->find('first', array('id' => $reserva['Reserva']['clientes_id']));
         /**
          * VERIFICO SE O CLIENTE TEM EMAIL CADASTRADO
          */
         if (!empty($dadoEmailReserva[0]['email']) && Session::read('Empresa.envio_sistema') == 1) {
             /**
              * envio o email para o cliente cadastrado para inserir na lista os dados das pessoas relacionadas
              */
             $email = new Email();
             $email->useTable = 'emails_sistema';
             if (in_array(Session::read('ContaEmpresa.contas_empresas_tipos_id'), array(1, 3, 5))) {
                 $registro = $email->find('first', array('tag' => 'email_confirmacao'));
             } else {
                 $registro = $email->find('first', array('tag' => 'email_confirmacao'));
             }
             /**
              * recupero o endereço da empresa
              */
             $endereco = $this->Endereco->findEnderecosEmpresa($this->empresas_id);
             $enderecoEmpresa = $endereco[0]['logradouro'] . ', ' . $endereco[0]['numero'] . ' | ' . $endereco[0]['cidade'] . ' - ' . $endereco[0]['bairro'] . ' - ' . $endereco[0]['uf'];
             /**
              * recupero as mesas
              */
             $mesaModel = new Mesa();
             $ambientesModel = new Ambiente();
             $mesas = $mesaModel->mesasReservas($reserva['Reserva']['id']);
             $ambientes = $ambientesModel->ambientesReservas($reserva['Reserva']['id']);
             /**
              * #faço a troca de siglas para personalizar o email
              */
             $dataMail = explode(' ', Utils::convertData($reserva['Reserva']['start']));
             $email->useTable = 'empresas_email_parametros';
             $email_parametros = $email->find('first', array('emails_sistema_id' => 5, 'empresas_id' => $this->empresas_id));
             $corpoEmailConfirmacao = $email->ajusteEmailConfirmacao($registro[0]['Email']['corpo_mail'], $email_parametros[0][$email->name]);
             $array = array('__CLIENTE__' => $cliente[0]['Cliente']['nome'], '__DATE__' => date('d/m/Y h:i:s'), '__NOME_FANTASIA__' => Session::read('Empresa.nome_fantasia'), '__CONVIDADOS__' => $reserva['Reserva']['qtde_pessoas'], '__LUGARES__' => $reserva['Reserva']['assentos'], '__ENDERECO_EMPRESA__' => $enderecoEmpresa, '__MESAS__' => join(' - ', array_values($mesas)), '__DATA_INICIO__' => $dataMail[0], '__HORAS_INICIO__' => $dataMail[1], '__SALAO__' => $dadoEmailReserva[0]['salao'], '__AMBIENTE__' => join(' - ', array_values($ambientes)), '__CAPACIDADE__' => $dadoEmailReserva[0]['capacidade'], '__URL_ATIVAR__' => Router::url(array('Reservas', 'confirmReservaEmail', $reserva['Reserva']['token'])));
             #envio o email de confirmação para o meu cliente cadastrado
             $objeto = new MailPHPMailer();
             $objeto->setAssunto('Confirmação : ' . Session::read('Empresa.nome_fantasia'));
             //$objeto->setRemetente();
             /**
              *   CORPO DO EMAIL
              */
             $corpoEmailConfirmacao = str_replace(array_keys($array), array_values($array), $corpoEmailConfirmacao);
             $objeto->setBody($corpoEmailConfirmacao);
             /**
              *   DESTINO PARA QUEM VAI O EMAIL - CLIENTE
              */
             $objeto->setDestinatario($dadoEmailReserva[0]['email'], $dadoEmailReserva[0]['cliente']);
             $emailEnvio = $objeto->sendMail();
             if ($emailEnvio) {
                 $gravaEmail = array('reservas_id' => $reserva['Reserva']['id'], 'empresas_id' => $reserva['Reserva']['empresas_id'], 'pessoas_id' => $this->pessoas_id, 'clientes_id' => $reserva['Reserva']['clientes_id'], 'created' => date('Y-m-d H:i:s'), 'status' => 1);
                 /**
                  * inserindo na tabela o envio do email
                  */
                 $this->Reserva->gravaEnvioEmail($gravaEmail);
                 echo json_encode(array('message' => 'Email enviado com sucesso!', "style" => 'success', 'time' => 5000, 'size' => 'sm', 'callback' => false, 'before' => "\$('#loading').fadeOut(500);", 'icon' => 'check', 'title' => 'Sucesso no envio!'));
             } else {
                 $gravaEmail = array('reservas_id' => $reserva['Reserva']['id'], 'empresas_id' => $reserva['Reserva']['empresas_id'], 'pessoas_id' => $this->pessoas_id, 'clientes_id' => $reserva['Reserva']['clientes_id'], 'created' => date('Y-m-d H:i:s'), 'status' => 0);
                 /**
                  * inserindo na tabela o envio do email
                  */
                 $this->Reserva->gravaEnvioEmail($gravaEmail);
                 echo json_encode(array('message' => 'Problema no servidor de envio dos emails, contate o suporte.', "style" => 'warning', 'time' => 5000, 'size' => 'sm', 'callback' => false, 'before' => "\$('#loading').fadeOut(500);", 'icon' => 'times', 'title' => 'Falha no envio!'));
             }
         } else {
             echo json_encode(array('message' => 'Não foi possivel reenviar seu email tente novamente mais tarde ou avise o suporte.', "style" => 'danger', 'time' => 5000, 'size' => 'sm', 'callback' => false, 'before' => false, 'icon' => 'times', 'title' => 'Falha no envio!'));
         }
     } catch (Exception $ex) {
         echo json_encode(array('message' => $ex->getMessage(), "style" => 'danger', 'time' => 5000, 'size' => 'sm', 'callback' => false, 'before' => false, 'icon' => 'times', 'title' => 'Falha no envio!'));
     }
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:82,代码来源:ReservasController.php

示例7: detail

 public function detail($id)
 {
     try {
         $email = Email::find($id);
         if (is_null($email)) {
             throw new Exception("This email could not be found.");
         }
         $data = Citrus::response('data', $email);
     } catch (Exception $e) {
         $data = Citrus::response('error', $e);
     }
     return $data;
 }
开发者ID:hackGFS,项目名称:api,代码行数:13,代码来源:MailController.php

示例8: move_to_sent

 public function move_to_sent($id)
 {
     $email = Email::find($id);
     $email->deleted = 0;
     $email->save();
     return Redirect::to('dashboard/emails?tab=sent');
 }
开发者ID:shinichi81,项目名称:Laravel4-Newsletter-Application,代码行数:7,代码来源:EmailController.php

示例9: function

            Route::get('dashboard/users/{id}/unban', 'UserController@un_ban');
            Route::get('dashboard/users/{id}/destroy', 'UserController@destroy');
            Route::group(['before' => 'csrf'], function () {
                Route::post('dashboard/users/store', 'UserController@store');
                Route::post('dashboard/users/update', 'UserController@update');
                Route::post('dashboard/users/bulk-destroy', 'UserController@bulk_destroy');
            });
        });
        Route::get('dashboard/logout', 'AuthenticationController@logout');
    });
    //Email Pages Frontend Stuff
    Route::get('email/{slug}/preview', 'FrontendController@preview');
    Route::get('email/{slug}', 'FrontendController@show');
    Route::get('email/show/{hashId}', function ($hashId) {
        $id = \Jamesy\Miscellaneous::decryptId($hashId);
        if ($email = Email::find($id)) {
        }
        return View::make('backend.emails.send_templates.view-in-browser', ['email_body' => $email->email_body]);
    });
    //Mailgun API Endpoint
    Route::post('VjwombzKYGxeAKLB', 'AnalyticController@delivered');
    Route::post('YlpnbJyeXGPORABk', 'AnalyticController@failed');
    Route::post('bQKgqoyPXyORMZeN', 'AnalyticController@opened');
    Route::post('EWOvPbGNPznDdJek', 'AnalyticController@clicked');
    Route::post('BLNlanrLvyAXgVkp', 'AnalyticController@bounced');
    Route::post('XxLMnpzjmyJDNPmZ', 'AnalyticController@complained');
    //Unsubscribe
    Route::get('unsubscribe/{id}', 'FrontendController@unsubscribe');
    //Etc
    Route::get('dashboard/pdf/test', 'SentEmailCustomController@test');
});
开发者ID:shinichi81,项目名称:Nifty-Newsletter,代码行数:31,代码来源:routes.php

示例10: destroy

 public function destroy($id)
 {
     Email::find($id)->delete();
     return Response::json(['message' => 'Email deleted']);
 }
开发者ID:shinichi81,项目名称:Nifty-Newsletter,代码行数:5,代码来源:TrashResourceController.php

示例11: recuperaSenha

 /**
  * @author FreelaPHP schuindt
  * @version 1.0
  * @todo metodo que realiza a recuperação de senha do usuario no banco de dados
  *
  * 
  * */
 public function recuperaSenha()
 {
     try {
         if (isset($_POST['email'])) {
             if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
                 $hash = Authentication::uuid();
                 if ($this->User->alteraHashSenha($_POST['email'], $hash)) {
                     $email = new Email();
                     $email->useTable = 'emails_sistema';
                     $registro = $email->find('first', array('tag' => 'recuperar_senha'));
                     #faço a troca de siglas para personalizar o email
                     $array = array('__EMAIL_REMETENTE__' => $_POST['email'], '__DATE__' => date('d/m/Y h:i:s'), '__URL__' => Router::url(array('Usuarios', 'resetarSenha', $hash)));
                     #envio o email de confirmação para o meu cliente cadastrado
                     $objeto = new MailPHPMailer();
                     $objeto->setAssunto('Reserva - Recuperar Senha!');
                     $objeto->setRemetente();
                     $objeto->setDestinatario($_POST['email'], 'Recuperar Senha');
                     $objeto->setBody(str_replace(array_keys($array), array_values($array), $registro[0]['Email']['corpo_mail']));
                     $objeto->sendMail();
                     $this->set('mensagem', 'Para alterar a senha clique no link enviado ao seu email');
                 } else {
                     $this->set('mensagem', 'Ocorreu algum erro no processo, tente novamente.');
                 }
             } else {
                 $this->set('mensagem', 'Email inválido');
             }
         }
         $this->set('title_layout', 'Esqueci minha senha');
         $this->render();
     } catch (Exception $ex) {
         echo $ex->getMessage();
     }
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:40,代码来源:UsuariosController.php

示例12: ItemModelId

 function ItemModelId($path)
 {
     /* find pol, sol and the type of item */
     list($pol_id, $sol_id, $rest) = sscanf($path, "/opt/xplico/pol_%d/sol_%d/%s");
     $type = strtok($rest, '/');
     /* set sol id and pol id to avoid error permision in the controller */
     $this->Session->write('pol', $pol_id);
     $this->Session->write('sol', $sol_id);
     /* controller and id */
     $control = null;
     $id = null;
     switch ($type) {
         case 'http':
             /* load model */
             $Feed = new Feed_xml();
             /* find id */
             $control = 'Feed_xml';
             $conditions = array('Feed_xml.rs_body' => $path);
             $param = array('recursive' => 0, 'fields' => array('Feed_xml.id'), 'conditions' => $conditions);
             $id = $Feed->find('first', $param);
             if ($id == null) {
                 /* load model */
                 $Web = new Web();
                 /* find id */
                 $control = 'Web';
                 $conditions = array("or" => array('Web.rq_header' => $path, 'Web.rs_header' => $path, 'Web.rq_body' => $path, 'Web.rs_body' => $path));
                 $param = array('recursive' => 0, 'fields' => array('Web.id'), 'conditions' => $conditions);
                 $id = $Web->find('first', $param);
             }
             break;
         case 'fbwchat':
             /* load model */
             $Fbc = new Fbchat();
             /* find id */
             $control = 'Fbchat';
             $conditions = array('Fbchat.chat' => $path);
             $param = array('recursive' => 0, 'fields' => array('Fbchat.id'), 'conditions' => $conditions);
             $id = $Fbc->find('first', $param);
             break;
         case 'ftp':
             /* load model */
             $Ftp = new Ftp_file();
             /* find id */
             $control = 'Ftp_file';
             $conditions = array('Ftp_file.file_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Ftp_file.id'), 'conditions' => $conditions);
             $id = $Ftp->find('first', $param);
             if ($id == null) {
                 /* load model */
                 $Ftp = new Ftp();
                 /* find id */
                 $control = 'Ftp';
                 $conditions = array('Ftp.cmd_path' => $path);
                 $param = array('recursive' => 0, 'fields' => array('Ftp.id'), 'conditions' => $conditions);
                 $id = $Ftp->find('first', $param);
             }
             break;
         case 'ipp':
         case 'pjl':
             /* load model */
             $Pjl = new Pjl();
             /* find id */
             $control = 'Pjl';
             $conditions = array("or" => array('Pjl.pcl_path' => $path, 'Pjl.pdf_path' => $path));
             $param = array('recursive' => 0, 'fields' => array('Pjl.id'), 'conditions' => $conditions);
             $id = $Pjl->find('first', $param);
             break;
         case 'mail':
             /* load model */
             $Mail = new Email();
             /* find id */
             $control = 'Email';
             $conditions = array('Email.mime_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Email.id'), 'conditions' => $conditions);
             $id = $Mail->find('first', $param);
             break;
         case 'mms':
             /* load model */
             $Mms = new Mmscontent();
             /* find id */
             $control = 'Mmscontent';
             $conditions = array('Mmscontent.file_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Mmscontent.id'), 'conditions' => $conditions);
             $id = $Mms->find('first', $param);
             break;
         case 'nntp':
             /* load model */
             $Nntp = new Nntp_article();
             /* find id */
             $control = 'Nntp_article';
             $conditions = array('Nntp_article.mime_path' => $path);
             $param = array('recursive' => 0, 'fields' => array('Nntp_article.id'), 'conditions' => $conditions);
             $id = $Nntp->find('first', $param);
             break;
         case 'telnet':
             /* load model */
             $Teln = new Telnet();
             /* find id */
             $control = 'Telnet';
             $conditions = array('Telnet.cmd' => $path);
//.........这里部分代码省略.........
开发者ID:xplico,项目名称:xplico,代码行数:101,代码来源:search_path.php

示例13: track

 /**
  *    TRACK EMAIL OPENS
  **/
 public function track($id)
 {
     if (isset($id) && !empty($id)) {
         if (isset($_GET['email']) && !empty($_GET['email'])) {
             $email = Email::find($id);
             if ($email) {
                 if ($_GET['email'] == $email->to and $email->status != 'sucess' and $email->status != 'danger') {
                     $email->status = 'success';
                     // Aberto pelo destinatário
                     $email->last_open = $_GET['email'];
                     // Notificação de leitura de email
                     Notification::create(['icon' => 'fa-check', 'title' => $email->to . ' recebeu seu e-mail!<br/><small><span class="timeago" title="' . date('Y-m-d H:i:s') . '"></span></small>', 'status' => false]);
                 }
                 $email->save();
             } else {
                 return "Não encontrado";
             }
             //Full URI to the image
             $graphic_http = 'http://basaltosegranitos.com.br/img/blank.gif';
             //Get the filesize of the image for headers
             $filesize = filesize('img/blank.gif');
             //Now actually output the image requested (intentionally disregarding if the database was affected)
             header('Pragma: public');
             header('Expires: 0');
             header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
             header('Cache-Control: private', false);
             header('Content-Disposition: attachment; filename="blank.gif"');
             header('Content-Transfer-Encoding: binary');
             header('Content-Length: ' . $filesize);
             //Begin the header output
             //header( 'Content-Type: image/gif' );
             readfile($graphic_http);
         } else {
             return "Informe o e-mail";
         }
     } else {
         return "Informe o id";
     }
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:42,代码来源:EmailsController.php

示例14: forward

 public function forward($id)
 {
     // Setting::forgetEmailSettingsCache($this->user);
     $email_configs = ['from_name' => Setting::getFromName($this->user), 'from_email' => Setting::getFromEmail($this->user), 'reply_to_email' => Setting::getReplyToEmail($this->user)];
     $tag_list = Tag::getTagList();
     $subscribers = Subscriber::getSubscribersForEmail();
     $subsArr = [];
     foreach ($subscribers as $subscriber) {
         $subsArr[$subscriber->email] = $subscriber->first_name . ' ' . $subscriber->last_name . '(' . $subscriber->email . ')';
     }
     $maillists = Maillist::getMaillistsForEmail();
     $listsArr = [];
     foreach ($maillists as $maillist) {
         $listsArr[$maillist->id] = $maillist->name . ' (' . count($maillist->subscribers) . ' subscribers)';
     }
     $email = Email::find($id);
     return View::make('backend.emails.edit', ['user' => $this->user, 'isAdmin' => $this->isAdmin, 'configs' => $this->configs, 'logged_in_for' => $this->logged_in_for, 'activeParent' => $this->activeParent, 'active' => 'createemails', 'subscribers' => $subsArr, 'mail_lists' => $listsArr, 'email_configs' => $email_configs, 'tag_list' => $tag_list, 'email' => $email]);
 }
开发者ID:shinichi81,项目名称:Nifty-Newsletter,代码行数:18,代码来源:EmailController.php


注:本文中的Email::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。