Ошибка при отправке почты после регистрации пользователя в laravel - PullRequest
0 голосов
/ 13 апреля 2019

я новичок в laravel, пытаюсь отправить письмо пользователям, если они успешно зарегистрировались, и в электронном письме оно будет содержать некоторые детали

В моем приложении создавалась новая учетная запись или новые пользователи, кроме электронной почтыне отправлял, он отображал эту ошибку на вкладке сети

message:    htmlspecialchars() expects parameter 1 to be string, object given (View: C:\xampp\htdocs\laravel Projects\bank\iscbank\resources\views\emails\welcome.blade.php)

вот мой код или отправляю письмо

$datty = array(
            'name' => $request->input('name'), 
            'email' => $request->input('email'), 
            'Authenticationkey' => $this->genAutKey, 
            'password' => $this->genPass,
            'AccountNumber' => $this->AccNum,
        );      
        // Mail::to($request->input('email'))->send(new WelcomeMail($datty));

        Mail::send('emails.welcome', ['datty'=>$datty], function ($message) use($datty){
            $message->from(Auth::user()->email, Auth::user()->name);    
            $message->to(Input::get('email'))->subject(Input::get('subject')); 
        });

вот мой код Welcomemail.php

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue; 

class WelcomeMail extends Mailable{
    use Queueable, SerializesModels;
    public $datty;

    public function __construct($datty){
        $this->datty = $datty;
    }

    public function build(){
        return $this->view('emails.welcome');
    }
}

вот мой код welcome.blade.php

<div style="background-color: #eeeeef; padding: 50px 0; ">     
<div style="max-width:640px; margin:0 auto; ">        
    <div style="color: #fff; text-align: center; background-color:#33333e; padding: 30px; border-top-left-radius: 3px; border-top-right-radius: 3px; margin: 0;">            
        <h1>Your account details</h1>        
    </div>        
    <div style="padding: 20px; background-color: rgb(255, 255, 255);">            
        <p style="color: rgb(85, 85, 85); font-size: 14px;"> 
            Hello {{ $datty['name']}},<br>
            <br>An account has been created successfully.
        </p>            
        <p style="color: rgb(85, 85, 85); font-size: 14px;"> 
            Please use the following info to login your account: 
        </p>            
        <hr>           
        <p style="color: rgb(85, 85, 85); font-size: 14px;"></p>            
        <p >
            <span style="color: rgb(85, 85, 85); font-size: 14px; line-height: 20px;">
                Email: {{ $datty['email'] }}
            </span><br>
        </p>            
        <p>
            <span style="color: rgb(85, 85, 85); font-size: 14px; line-height: 20px;">
                Password:&nbsp;{{ $datty['password'] }}
            </span>
        </p>          
        <p>
            <span style="color: rgb(85, 85, 85); font-size: 14px; line-height: 20px;">
                Activation Key:&nbsp;{{$datty['Authenticationkey']}}
            </span>
        </p>            
        <p style="color: rgb(85, 85, 85);"><br></p>            
        <p style="color: rgb(85, 85, 85); font-size: 14px;">Thanks</p>        
    </div>    
</div>

Пожалуйста, как я могу решить эту проблему, я пробовал поиск в Интернете, но все они говорят то же самое, пожалуйста,

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...