@@ -331,7 +331,15 @@ protected function updateUser($user)
331
331
protected function emailVerificationLink (AuthenticatableContract $ user , $ subject , $ from = null , $ name = null )
332
332
{
333
333
return $ this ->mailer ->send ($ this ->emailView , compact ('user ' ), function ($ m ) use ($ user , $ subject , $ from , $ name ) {
334
- $ m = $ this ->createVerificationEmail ($ m , $ user , $ subject , $ from , $ name );
334
+ if (! empty ($ from )) {
335
+ $ m ->from ($ from , $ name );
336
+ }
337
+
338
+ $ m ->to ($ user ->email );
339
+
340
+ $ m ->subject (is_null ($ subject ) ? trans ('laravel-user-verification::user-verification.verification_email_subject ' ) : $ subject );
341
+
342
+ event (new VerificationEmailSent ($ user ));
335
343
});
336
344
}
337
345
@@ -347,7 +355,15 @@ protected function emailVerificationLink(AuthenticatableContract $user, $subject
347
355
protected function emailQueueVerificationLink (AuthenticatableContract $ user , $ subject , $ from = null , $ name = null )
348
356
{
349
357
return $ this ->mailer ->queue ($ this ->emailView , compact ('user ' ), function ($ m ) use ($ user , $ subject , $ from , $ name ) {
350
- $ m = $ this ->createVerificationEmail ($ m , $ user , $ subject , $ from , $ name );
358
+ if (! empty ($ from )) {
359
+ $ m ->from ($ from , $ name );
360
+ }
361
+
362
+ $ m ->to ($ user ->email );
363
+
364
+ $ m ->subject (is_null ($ subject ) ? trans ('laravel-user-verification::user-verification.verification_email_subject ' ) : $ subject );
365
+
366
+ event (new VerificationEmailSent ($ user ));
351
367
});
352
368
}
353
369
@@ -364,7 +380,15 @@ protected function emailQueueVerificationLink(AuthenticatableContract $user, $su
364
380
protected function emailQueueOnVerificationLink ($ queue , AuthenticatableContract $ user , $ subject , $ from = null , $ name = null )
365
381
{
366
382
return $ this ->mailer ->queueOn ($ queue , $ this ->emailView , compact ('user ' ), function ($ m ) use ($ user , $ subject , $ from , $ name ) {
367
- $ m = $ this ->createVerificationEmail ($ m , $ user , $ subject , $ from , $ name );
383
+ if (! empty ($ from )) {
384
+ $ m ->from ($ from , $ name );
385
+ }
386
+
387
+ $ m ->to ($ user ->email );
388
+
389
+ $ m ->subject (is_null ($ subject ) ? trans ('laravel-user-verification::user-verification.verification_email_subject ' ) : $ subject );
390
+
391
+ event (new VerificationEmailSent ($ user ));
368
392
});
369
393
}
370
394
@@ -381,7 +405,15 @@ protected function emailQueueOnVerificationLink($queue, AuthenticatableContract
381
405
protected function emailLaterVerificationLink ($ seconds , AuthenticatableContract $ user , $ subject , $ from = null , $ name = null )
382
406
{
383
407
return $ this ->mailer ->later ($ seconds , $ this ->emailView , compact ('user ' ), function ($ m ) use ($ user , $ subject , $ from , $ name ) {
384
- $ m = $ this ->createVerificationEmail ($ m , $ user , $ subject , $ from , $ name );
408
+ if (! empty ($ from )) {
409
+ $ m ->from ($ from , $ name );
410
+ }
411
+
412
+ $ m ->to ($ user ->email );
413
+
414
+ $ m ->subject (is_null ($ subject ) ? trans ('laravel-user-verification::user-verification.verification_email_subject ' ) : $ subject );
415
+
416
+ event (new VerificationEmailSent ($ user ));
385
417
});
386
418
}
387
419
@@ -398,33 +430,16 @@ protected function emailLaterVerificationLink($seconds, AuthenticatableContract
398
430
protected function emailLaterOnVerificationLink ($ queue , $ seconds , AuthenticatableContract $ user , $ subject , $ from = null , $ name = null )
399
431
{
400
432
return $ this ->mailer ->laterOn ($ queue , $ seconds , $ this ->emailView , compact ('user ' ), function ($ m ) use ($ user , $ subject , $ from , $ name ) {
401
- $ m = $ this -> createVerificationEmail ( $ m , $ user , $ subject , $ from, $ name );
402
- } );
403
- }
433
+ if (! empty ( $ from)) {
434
+ $ m -> from ( $ from , $ name );
435
+ }
404
436
405
- /**
406
- * Creates and format the e-mail to be sent.
407
- *
408
- * @param string $mail
409
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
410
- * @param string $subject
411
- * @param string $from
412
- * @param string $name
413
- * @return mixed
414
- */
415
- protected function createVerificationEmail ($ mail , $ user , $ subject , $ from , $ name )
416
- {
417
- if (! empty ($ from )) {
418
- $ mail ->from ($ from , $ name );
419
- }
437
+ $ m ->to ($ user ->email );
420
438
421
- $ mail -> to ( $ user -> email );
439
+ $ m -> subject ( is_null ( $ subject ) ? trans ( ' laravel- user-verification::user-verification.verification_email_subject ' ) : $ subject );
422
440
423
- $ mail ->subject (is_null ($ subject ) ? trans ('laravel-user-verification::user-verification.verification_email_subject ' ) : $ subject );
424
-
425
- event (new VerificationEmailSent ($ user ));
426
-
427
- return $ mail ;
441
+ event (new VerificationEmailSent ($ user ));
442
+ });
428
443
}
429
444
430
445
/**
0 commit comments