Laravel: 3 Ways to Send a Welcome Email (Controller vs Observer vs Events)

Laravel: 3 Ways to Send a Welcome Email (Controller vs Observer vs Events)

Laravel Daily

3 года назад

43,426 Просмотров

If you have a newly registered user, you may want to send a welcome email or perform some other action with that user's profile. In Laravel, I will show you three ways how to achieve it.

Also, at the end of the video, you will find out, how much I earn from my Laravel courses :)

- - - - -
Try our Laravel QuickAdminPanel: https://bit.ly/quickadminpanel
Enroll in my Laravel courses: https://laraveldaily.teachable.com
Ссылки и html тэги не поддерживаются


Комментарии:

@hamidoahmed9985
@hamidoahmed9985 - 29.08.2023 09:07

thanks a lot

Ответить
@sixtusagbo
@sixtusagbo - 20.10.2022 13:25

Highly simplified🥂

Ответить
@abdulrahmanalsefi6418
@abdulrahmanalsefi6418 - 09.10.2022 22:32

How can I send a welcome message to users email not to mailtrap ?

What should I do to do that ?

Ответить
@abdulrahmanalsefi6418
@abdulrahmanalsefi6418 - 09.10.2022 22:31

Thank you very much , great tutorial

Ответить
@habetech
@habetech - 07.07.2022 20:16

any tutorial how to read emails form dashboard for example Mailbox

Ответить
@steveowago1089
@steveowago1089 - 07.07.2022 19:09

very educative indeed. Been testing the sending emails using google mail server the emails end in the spam folder. How can we overcome this?

Ответить
@merlinafera4865
@merlinafera4865 - 24.06.2022 08:33

yes

Ответить
@tesshsu1
@tesshsu1 - 31.03.2022 15:17

Hi Thanks for video I'm your fan, one question : Is any performance will be better between those method ? and might be like other complicated notification: like in job search website make a candidate send CV notification etc show used controller directly ? cause as I think observer is more general action ? tks

Ответить
@MrFranciscoooooo
@MrFranciscoooooo - 07.03.2022 02:49

Can I put event inside the observer?

Ответить
@mostafasaid9861
@mostafasaid9861 - 15.02.2022 01:18

Thank you for that great video!

Ответить
@TheAikinsGuy
@TheAikinsGuy - 21.10.2021 05:43

You make programming look sooo easy. Thank you 🙌

Ответить
@SilVer-hu2ps
@SilVer-hu2ps - 18.10.2021 21:36

Now I know where to configure when I try sending otp. Got the sms gateway already but I'm not working on it yet. Thanks. First time I've heard observers.

Ответить
@SanderCokart
@SanderCokart - 25.08.2021 03:41

Thank you

Ответить
@meetdave7659
@meetdave7659 - 07.06.2021 13:56

Such an amazing video to learn this concept. Thanks for this.

Ответить
@davidcopperfield2278
@davidcopperfield2278 - 25.05.2021 13:52

hi, i'm using the second method with the observer,
it works fine, but I m trying to grab the created user data to put it inside the email, to greet the person per name.
just concatenating with $user->first_name within the WelcomeEmailNotification.php doesn't work
any suggestions ?

Ответить
@eleazarfederio1718
@eleazarfederio1718 - 10.02.2021 18:51

Sir do you have video about broadcat in laravel?

Ответить
@AksoomHussain7866
@AksoomHussain7866 - 05.02.2021 14:43

what is the difference on the performance basis like event as search or make a request efficiently between multiple users and also by using service container

Ответить
@upyrable
@upyrable - 27.01.2021 20:59

What part of code calls the “something” function in login controller?

Ответить
@sohaibelmediouni9791
@sohaibelmediouni9791 - 13.01.2021 03:26

how can i generate QR code and send it in email

Ответить
@haratmalli6608
@haratmalli6608 - 12.01.2021 02:15

Queued up the events makes registration faster.

Ответить
@AlfredoElizondoLife
@AlfredoElizondoLife - 13.12.2020 20:09

Do you know how to get rid of the "Regard's" word , i exported the mail vendor folder and cant find the word or transalation, nither on the html or the text folders, is there something im missing?

Ответить
@bashardlaleh2110
@bashardlaleh2110 - 09.12.2020 22:18

Thank you

Ответить
@khalilkhassep8778
@khalilkhassep8778 - 09.12.2020 17:27

Thank you for being around to show us all of this wish if you have a full free course for people who like welling to learn web development using laravel and can't afford a high informative qoualtiy content as you do in your 10 minutes vedios.
Anyway really thank you and wish to support you more than a subscribe and like.

Ответить
@HassanHafeez007
@HassanHafeez007 - 09.12.2020 09:38

I am familiar with jobs and queues in laravel and also how to run queue workers in dev env. But recently I encounter an issue while running queue workers in test env. the thing I did on test env is to set a cronjob in crontab that runs every minute to see if there is a new user registered etc then send an email to that user. This thing exhaust server's ram and due to this issue server was not responding. and when I remove cronjob from crontab and restart my server then my application was running fine. My question is how to run queue jobs in test or production env more effectively.

Ответить
@AbrarAhmad-mz8vl
@AbrarAhmad-mz8vl - 08.12.2020 20:29

You made good decision to keep the original video with errors. It is really great learning to see how senior developer solves an error.

Ответить
@lorenipsum5831
@lorenipsum5831 - 08.12.2020 19:19

Is there a possibility that you have discount coupons for third world countries like Argentina? in laraveldaily

Ответить
@neerajsinghtangariya2587
@neerajsinghtangariya2587 - 08.12.2020 16:10

very very useful.......Thank you :)

Ответить
@tousifali1118
@tousifali1118 - 08.12.2020 14:09

Any idea how to send HTML email via Mail class without having a view template. I am trying

Mail::html('This html message will be fetched from database', function ($message) {
$message->to('[email protected]');
$message->from(env('APP_EMAIL'), 'Website Name');
$message->subject("Email Subject Here");
});

This code throws this error "Address in mailbox given [] does not comply with RFC 2822, 3.6.2.".

Also, I am using this code in the listener. Thank you in advance.

Ответить
@unomas9686
@unomas9686 - 08.12.2020 13:32

laravel websockets simple chat example ? please ?¿

Ответить
@yuliarahma1300
@yuliarahma1300 - 08.12.2020 12:35

make notification via telegram pliiss,,

Ответить
@ndeblauw
@ndeblauw - 08.12.2020 10:42

Good one. Only missed a remark about "sending e-mails should be done as much as possible through a queue, for better UX (speed)"

Ответить
@nabeelyousafpasha
@nabeelyousafpasha - 08.12.2020 10:32

Thanks for Sharing Knowledge. You previous video regarding this topic 'Observers VS. Events Listeners" was worth watching too. Respect from Pakistan.

Ответить
@toitespasmoi
@toitespasmoi - 08.12.2020 09:09

Yeeeeeeeeet

Ответить