CodeIgniter Forums
emails with Debug View??? - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: emails with Debug View??? (/showthread.php?tid=76945)

emails with Debug View??? - Leo - 07-06-2020

Hi all.
So I'm trying to send an email, using sendmail. The email and subject get sent all right - but the body is like:
<!-- DEBUG-VIEW START 1 APPPATH/Config/../Views/emails/for_customer.php -->
<html lang="ru">
<div style="margin: 10px 0;padding: 0;background-color: #52a620">
    <h1 style="text-align: center;">
        <a style="text-decoration: none; color: #FFF; font-weight: lighter;"

and everything is just in text! No html, no styling and  <!-- DEBUG-VIEW START 1 APPPATH/Config/../Views/emails/for_customer.php --> in the beginning!
How to make it normal?

This is my controller:
PHP Code:
protected function sendNotice(array $details)
    $cms $this->cms();
    $this->data['order'] = (object)$details;
    $this->data['products'] = json_decode($details['details']);
    $this->data['time'] = get_russian_time(date('Y-m-d')) .' 'date('H:i');

    $emailBody view('emails/for_customer'$this->data);

    $email = \Config\Services::email();

    $email->setFrom('[email protected]'.$cms->site_name$cms->organization);
    $email->setSubject('Заказ '.$details['id'].', '.$cms->site_name);

RE: emails with Debug View??? - Leo - 07-07-2020

Ok, I figured it out.
In app/Config/Email.php
I set $mailtype to 'html'
In app/Config/Toolbar.php
I commented out \CodeIgniter\Debug\Toolbar\Collectors\Views::class

In production the toolbar is not used, so the second action is not needed.