Jump to content

netorica

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by netorica

  1. Thank you for the lead I have successfully created an email template and sent it by using this code

    $this->Emails->send('Verifyemail.request_verify', Configure::get('Blesta.company_id'), null, $email, $tags);

    Now my question is why it doesn't log on the Email Log of the client?

  2. I want to send an email automatically to a client when his/her service is near to be cancelled.

    The following is the step by step scenario

    1) The service was set to cancel at end of its term

    2) 3 days before the set cancel date I want to send an email automatically

    3) 1 day before the set cancel date I want to send an email automatically

    Is this possible?

  3. I have a plugin class and I want to check on Appcontroller.structure event if a client is currently logged in. But

     $this->Session->read("blesta_client_id");

    returns null. This is my current code right now

    <?php
    class OverridesPlugin extends Plugin {
        
        private $Record;
    
        public function __construct() {
            $this->Record = new Record();
            $this->loadConfig(dirname(__FILE__) . DS . "config.json");
        }
    
        public function install($plugin_id) {
        
        }
    
        public function getEvents() {
            return array(
                array(
                    'event' => "Appcontroller.preAction",
                    'callback' => ["this", "preAction"]
                ),
                array(
                    'event' => "Appcontroller.structure",
                    'callback' => ["this", "structure"]
                ),
            );
        }
    
        public function preAction($event){
            Loader::loadModels($this, ['Overrides.OverridesSettings']);
        }
    
        public function structure($event){
    
            
           $logged_in_client = $this->Session->read("blesta_client_id");
            $url_details = $event->getParams();
            echo '<pre>'.var_export($logged_in_client,true).'</pre>';
            exit(1);
    
        }
    
    }

    Can you tell me what is the right way to check the client sessions in a plugin class?

     

    Thank you

×
×
  • Create New...