0

model file has following content

 <?php
class ModelGuestbookGuestbook extends Model {
  public function processGuestbookEntry($data) {
    // send email notification to store admin 
    $mail = new Mail();
    $mail->protocol = $this->config->get('config_mail_protocol');
    $mail->parameter = $this->config->get('config_mail_parameter');
    $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
    $mail->smtp_username = $this->config->get('config_mail_smtp_username');
    $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
    $mail->smtp_port = $this->config->get('config_mail_smtp_port');
    $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

    $mail->setTo($this->config->get('config_email'));
    $mail->setFrom($this->config->get('config_email'));
    $mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
    $mail->setSubject($data['subject']);
    $mail->setText($data['message']);
    $mail->send();
  }
}

I have a submit button which is supposed to trigger this model method processGuestbookEntry(). But when I hit submit I'am getting the following error

Notice: Undefined property: Proxy::processGuestBookEntry in F:\Xampp\htdocs\opencart\upload\system\engine\action.php on line 51

Note: my method is processGuestbookEntry(), Error is processGuestBookEntry

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
AkhilRaj
  • 41
  • 1
  • 8
  • The error seems to be where you're trying to call the method so that's the code we need to see. – M. Eriksson Nov 15 '19 at 05:48
  • It is that by default sending mail on local machine is not configured. You need configure it. Read this: https://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost – K. B. Nov 15 '19 at 07:29

0 Answers0