Laravel community i want to send another email with user cardentials when i click verify email button.
Anyone have any idea? How is it possible?
Laravel community i want to send another email with user cardentials when i click verify email button.
Anyone have any idea? How is it possible?
There is 2 ways to do this:
You may override the verified method on App\Http\Controllers\Auth\VerificationController class to do whatever you want to do after user's email address is verified:
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Http\Response;
class VerificationController extends Controller
{
//...
/**
* The user has been verified.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function verified(Request $request)
{
//TODO: send another email as you want!
return $request->wantsJson()
? new Response('', 204)
: redirect($this->redirectPath())->with('verified', true);
}
}
Alternatively, you may attach a listener to Illuminate\Auth\Events\Verified event in your EventServiceProvider
See Laravel docs for more info.