<?php

class EmailClienteDonoLoja extends Cliente
{

  public function __construct($registry)
  {
    parent::__construct($registry);
    parent::getConfigMail();
  }

  public function sendTask($typeemail, $cliente_id, $attribute_value)
  {

    try {
      if (!$this->config->get('config_account_mail')) {
        throw new exception('O configuração de alerta de cliente esta desabilitada. E-mail referente cliente: ' . $cliente_id . ' não enviado!');
      }

      parent::getInfosOwerCustomer($cliente_id);

      $this->mail->setTo($this->to);
      $this->mail->setSender($this->sender);
      $this->mail->setSubject(html_entity_decode($this->subject, ENT_QUOTES, 'UTF-8'));
      $this->mail->setText(html_entity_decode($this->text, ENT_QUOTES, 'UTF-8'));
      $this->mail->send(true);

      parent::sendAdditionalEmail($attribute_value);
    } catch (Exception $e) {
      throw $e;
    }

  }


}