Welcome Guest, Not a member yet? Register   Sign In
emails with Debug View???
#1

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">
<body>
<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']);
    helper('language');
    $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('norepy@'.$cms->site_name$cms->organization);
    $email->setTo($details['email']);
    $email->setSubject('Заказ '.$details['id'].', '.$cms->site_name);
    $email->setMessage($emailBody);
    $email->send();

You can see things I made with codeigniter here: itart.pro its not overly impressive as I have very little time to learn.
Reply
#2

Ok, I figured it out.
In app/Config/Email.php
I set $mailtype to 'html'
and
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.
You can see things I made with codeigniter here: itart.pro its not overly impressive as I have very little time to learn.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB