<?php

/*
 * PuzzleApp
 * Webemyos
 * Jérôme Oliva
 * GNU Licence
 */

namespace Apps\Base\Helper;

use Apps\EeApp\Entity\EeAppAdmin;
use Core\Core\DataBase;
use Core\Entity\User\User;
use Core\Utility\File\File;


/**
 * Helper for Send Email
 * Send Base Email or by Email App
 * @author jerome
 */
class EmailHelper 
{
    public static function SendEmail($core, $code, $email, $params, $subject, $message) {

        $app = \Apps\EeApp\Helper\AppHelper::HaveApp($core, "Notify");

        if($app != false){

            $appPath = "\Apps\\" .$app->Name->Value . "\\". $app->Name->Value;  
            $notify = new $appPath($core);
            return $notify->SendEmail($code, $email, $params, $subject, $message);
        } else {
            //TODO ON FAIT UN EMAIL STANDAT
            
        }
    }
}