0
Q:

registration welcome email laravel

Hello {{ $name }},<br><br>

Welcome to MyNotePaper.<br><br>

Thank You,<br>
MyNotepaper
0
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=48664********
MAIL_PASSWORD=6cfa6********
0
use Illuminate\Support\Facades\Mail;

protected function create(array $data)
{
    $user = User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => Hash::make($data['password']),
    ]);

    // email data
    $email_data = array(
        'name' => $data['name'],
        'email' => $data['email'],
    );

    // send email with the template
    Mail::send('welcome_email', $email_data, function ($message) use ($email_data) {
        $message->to($email_data['email'], $email_data['name'])
            ->subject('Welcome to MyNotePaper')
            ->from('[email protected]', 'MyNotePaper');
    });

    return $user;
}
0

New to Communities?

Join the community