I am trying to add bbc to verification and password rest link mail in laravel default auth system. There is no mail function in laravel default Auth system how can I add ->bcc() in verification mail and password reset mail.
Any help would be appriciated.
like this
Mail::to($request->user())
->cc($moreUsers)
->bcc('[email protected]')
->send(new OrderShipped($order));
forgotpasswordcontroller.php
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Password;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Auth;
class ForgotPasswordController extends Controller
{
use SendsPasswordResetEmails;
public function __construct()
{
$this->middleware('guest');
}
public function sendResetLinkEmail(Request $request)
{
$this->validateEmail($request);
$response = $this->broker()->sendResetLink(
$request->only('email')
);
return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response);
}
}
verificationcontroller.php
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
use VerifiesEmails;
protected $redirectTo = 'shop/home';
public function __construct()
{
$this->middleware('auth')->only('verify');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}
You can also listen for the mail sent event, like so:
app/Providers/EventServiceProvider.php
Then, app/Listeners/LogOutboundMessages.php