Пример #1
0
        $asunto = "Has recibido un comentario en una oferta";
        $mailCont = '</strong> ha comentado en su oferta, en el proyecto "<span style="color:#cc6600; font-weight:bold;">' . $rs_user_pro->pro_tit . '</span>". Para ver el comentario haz click <a href="' . FConfig::getUrl('proyecto') . '?id=' . $rs_user_pro->pro_id . '" target="_blank">aquí</a>.';
        $not_user = Notification::create($us_pro['id'], 'Has recibido un mensaje de ' . $completeName, Notification::TYPE_COMMENT, json_encode($notificationData));
    } else {
        if ($_COOKIE['id'] == $rs_user_pro->user_id) {
            $completeName = $us_pro['full_name'];
            $to = $us_of['email'];
            $asunto = "Has recibido un comentario en una de tus ofertas";
            $mailCont = '</strong> ha comentado en tu oferta, en el proyecto "<span style="color:#cc6600; font-weight:bold;">' . $rs_user_pro->pro_tit . '</span>". Para ver el comentario haz click <a href="' . FConfig::getUrl('proyecto') . '?id=' . $rs_user_pro->pro_id . '" target="_blank">aquí</a>.';
            $not_user = Notification::create($us_of['id'], 'Has recibido un mensaje de ' . $completeName, Notification::TYPE_COMMENT, json_encode($notificationData));
        }
    }
    //End notification
    $sender_us = getUserInfo($_COOKIE['id']);
    $params = array('site_url' => FConfig::getUrl('site_url'), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $completeName, 'comment_name' => $sender_us['name'] . ' ' . $sender_us['lastname'], 'content' => $mailCont);
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/comentarioOfertaEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
    $arreglo[] = array('resp' => "Se ha enviado la información");
    echo json_encode($arreglo);
}
if ($act == "validarPago") {
    $pro_id = $_REQUEST['pro_id'];
    $oferta_id = $_REQUEST['oferta_id'];
    $oferta = listAll("pro_transactions", "WHERE t_oferta_id = '{$oferta_id}' AND t_pro_id = '{$pro_id}' AND t_status = 'L'");
    $row = mysql_num_rows($oferta);
    if ($row > 0) {
        $arreglo[] = array('resp' => "true");
    } else {
Пример #2
0
    $isReferred = false;
}
// Create user
$user = $app->getModel('User')->create($user_name, $user_lastname, $user_email, $user_pass, $user_type);
if (isset($user->id)) {
    // Initialize user detail
    UserDetail::init($user->id, $user->user_type);
    $to = $user_email;
    $toName = $user_name . ' ' . $user_lastname;
    $confirmUrl = FConfig::getUrl('confirmacion') . '?c=' . $user->act_code;
    if ($isReferred) {
        $confirmUrl .= '&ru=' . $ru . '&rm=' . $rm;
    }
    $asunto = "Confirmación de registro";
    $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'confirmacion_url' => $confirmUrl);
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/registroEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to, 'name' => $toName));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
    // Event: Creación de perfil
    $events = FAnalytics::getInstance();
    if ($user_type == User::USER_TYPE_PHOTOGRAPHER) {
        $events->trackEvent('Usuario - Creaciones de perfil', 'Creación de fotógrafo', $user->id);
    } elseif ($user_type == User::USER_TYPE_CLIENT) {
        $events->trackEvent('Usuario - Creaciones de perfil', 'Creación de cliente', $user->id);
    }
    if ($isReferred) {
        if ($user_type == User::USER_TYPE_PHOTOGRAPHER) {
            $events->trackEvent('Referidos - Creaciones de perfil', 'Creación de fotógrafo referido desde ' . $rm, $ru);
        } elseif ($user_type == User::USER_TYPE_CLIENT) {
Пример #3
0
<?php

use Fototea\Config\FConfig;
use Fototea\Util\FMailer;
require '../vendor/autoload.php';
include_once '../scripts/libSM.php';
$user_email = $_REQUEST['user'];
$act_code = $_REQUEST['act-code'];
//action recover password
if ($_REQUEST['act'] == "recuperar") {
    $rs_user = mysql_fetch_object(listAll("user", "WHERE user = '******'"));
    $to = $rs_user->user;
    $toName = $rs_user->name . ' ' . $rs_user->lastname;
    $asunto = "Recuperar contraseña";
    $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'recuperar_url' => FConfig::getUrl('reinicia-contrasena') . '?c=' . $rs_user->act_code);
    $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/recuperarContrasenaEmail.html'));
    $mailer = new FMailer();
    $receivers = array(array('email' => $to, 'name' => $toName));
    $mailer->setReceivers($receivers);
    $mailer->sendEmail($asunto, $body);
    $arreglo[] = array('resp' => "Se ha enviado la información");
    echo json_encode($arreglo);
}
//action rest password
if ($_REQUEST['act'] == "reset") {
    $pass = sha1($_REQUEST['pass']);
    $rs_user2 = mysql_fetch_object(listAll("user", "WHERE act_code = '{$act_code}'"));
    $salt = $rs_user2->salt;
    $newPass = sha1($salt . $pass);
    updateTable("user", "password = '******'", "act_code = '{$act_code}'");
    $arreglo[] = array('resp' => "Se ha enviado la información");
Пример #4
0
         $dataProfile[UserDetail::USER_DETAIL_LABORAL_EXPERIENCE] = json_encode($experienciaLaboral);
         $dataProfile[UserDetail::USER_DETAIL_LANGUAGES] = json_encode($idiomas);
         $dataProfile[UserDetail::USER_DETAIL_HABILITIES] = json_encode($habilidades);
         $dataProfile[UserDetail::USER_DETAIL_RUT] = $rut;
         $dataProfile[UserDetail::USER_DETAIL_PAYMENT_USER] = $user_pago;
         // Update interests
         UserDetail::updateInterests($currentUser->id, $interes);
     }
     // Update detail user info
     UserDetail::update($currentUser->id, $dataProfile);
     if ($validNewEmail) {
         // Send email with link to activate new email
         $confirmUrl = UrlHelper::getUrl('actions/perfilAction.php') . '?act_code=' . $user->act_code . '&new_email_code=' . $user->new_email_code . '&act=new_email_confirmation';
         $asunto = "Confirmación de cambio de correo electrónico";
         $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'fullname' => $currentUser->full_name, 'confirmation_url' => $confirmUrl);
         $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/newEmailConfirmation.html'));
         $mailer = new FMailer();
         $receivers = array(array('email' => $currentUser->email, 'name' => $currentUser->full_name));
         $mailer->setReceivers($receivers);
         $mailer->sendEmail($asunto, $body);
         $app->addMessage("Un correo electrónico te ha sido enviado a la dirección <b>" . $email . "</b> para confirmarla.");
         $app->redirect($app->getHelper('UrlHelper')->getUrl('editarPerfil'));
     } else {
         $app->redirect($app->getHelper('UrlHelper')->getUrl('perfil'));
     }
     return;
 }
 // Cancel new email
 if ($action == 'cancel_new_email') {
     $userId = intval($app->getRequest()->get('user_id'));
     $data = array('new_email' => null, 'new_email_code' => null);
Пример #5
0
 public static function emailProjectOwner($offer, $winner, $project, $projectOwner)
 {
     // Enviar correo a cliente
     $asunto = "Has adjudicado un proyecto. ¡Buen Trabajo!";
     $params = array('site_url' => UrlHelper::getUrl(), 'logo_url' => UrlHelper::getUrl('images/logo_footer.png'), 'check_url' => UrlHelper::getUrl('images/check_green.gif'), 'client_name' => $projectOwner['full_name'], 'oferta_winner' => $offer->bid, 'proyecto_titulo' => $project->pro_tit, 'projecto_date' => DateHelper::getShortDate($project->pro_date), 'proyecto_url' => UrlHelper::getProjectUrl($project->pro_id), 'photograph_name' => $winner['full_name'], 'photograph_email' => $winner['email'], 'photograph_phone' => $winner['movil'], 'photograph_location' => $winner['ciudad'] . ', ' . $winner['direccion']);
     $mailer = new FMailer();
     $body = $mailer->replaceParameters($params, file_get_contents(UrlHelper::getBasePath() . '/views/emails/adjudicarProyectosClienteEmail.html'));
     $receivers = array(array('email' => $projectOwner['email']));
     $mailer->setReceivers($receivers);
     $mailer->setBCC(array(array('email' => FConfig::getValue('contacto_email'))));
     $mailer->sendEmail($asunto, $body);
 }