Should You Use a Notification or a Mailable?

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024
  • There's more than one way to send emails in Laravel. So should you always use a Mailable? Or what's a Notification? Should you use that even if you're just ending emails?
    Well... it depends. :) So why don't we take a look at why you might want to use one over the other and then you and your team can decide which is best to use for your particular use-case.
    Links:
    Mail Docs: laravel.com/do...
    Notification Docs: laravel.com/do...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 40

  • @filon861
    @filon861 หลายเดือนก่อน +2

    Thank you. Great content as always. One thing I'd probably include on the notification email is the meetup name so such cases where a user (organizer) has multiple meetups would know which of them a new registrant has signed up for.

  • @bhaidar
    @bhaidar หลายเดือนก่อน +1

    Very nice video Josh, as usual. In general, I prefer using Notification as it allows me to send a notification via different methods. One nice thing about Notifications too is the ability to send on-demand notifications for "non-registered-users", hence functioning similar to how a Mailable work. Thanks

  • @kyledoesdev
    @kyledoesdev หลายเดือนก่อน +1

    Hey i really enjoyed this video. I personally always reach for notifications rather than mailables. It's a habit I developed from my job but carried over into my personal projects.

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +3

      Thanks for watching Kyle! Yeah, I didn't even know for the longest time that notifications could be emails too, but now I'm reaching for them more and more. :)
      -Josh

    • @kyledoesdev
      @kyledoesdev หลายเดือนก่อน +1

      @@LaravelPHP sweet! Theyre super powerful, love em!

  • @MarkSnape
    @MarkSnape หลายเดือนก่อน

    at the end you said it comes down to your personal preference, but a common scenario is giving the user the choice of how they want to receive the notification. So the user could manage their preferences and say, notify me by email, by text, or a daily digest (for example), or all three. Notifications handles all this so if you chose mailable initially, you would need to convert it over.

  • @mohamednafil8983
    @mohamednafil8983 หลายเดือนก่อน +9

    I had the same confusion. Thanks for your explanation

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +5

      I did too! That's why I made the video. It always helps clear things up for me when I have to learn it enough to share it with someone else. :)
      -Josh

  • @orpheusohms
    @orpheusohms 27 วันที่ผ่านมา

    Use Mailables within your notification. Mailables allow for more advanced configuration and templating.

  • @vitalikartsivadze
    @vitalikartsivadze หลายเดือนก่อน

    Hi, nice comparison. What's the name of the extension telling who and when updated a specific part of the code?
    Cheers 🎉

  • @unTanana
    @unTanana 9 ชั่วโมงที่ผ่านมา

    Hey, is this vscode that you are using? If yes, how did you make it look so pretty? Especially the files finder :D

  • @jebiboy
    @jebiboy หลายเดือนก่อน +2

    Oh this just cleared my confusion when to use notification and mailable. Thank you so much. Btw, what app are you using when viewing the delivered sample notifications/mails?

    • @SiddharthPant
      @SiddharthPant 26 วันที่ผ่านมา

      I think he must be using Herd's mail feature. But that's a paid feature. For free alternatives, you can look for Mailpit or even Laravel's Telescope has a mail UI.

  • @TrondHus
    @TrondHus หลายเดือนก่อน

    You could probably send a notification when the user (for instance the admin of the meetup you used as an example) is logged in. If he/She is not logged in, then you send an e-mail.

  • @kouceylahadji
    @kouceylahadji หลายเดือนก่อน

    Personally when I just need to send email I use email, you have more flexibility(Multiple receivers, add cc, bcc and more...)
    Notification is good when you can for example to show the user list of notifications(using DB), send SMS or slack message

  • @smokeyoak
    @smokeyoak หลายเดือนก่อน

    This is relevant to my interests.

  • @jacobdelcroix
    @jacobdelcroix หลายเดือนก่อน +1

    Great explanation, thanks. Btw what’s your theme and font? Looks nice!

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +3

      Thanks for watching! It's the Catppuccin Frappe theme and Dank Mono font.
      -Josh

  • @mel-182
    @mel-182 หลายเดือนก่อน +1

    Hi! I have to ask, what is your keybaord switch? Sounds creamy.

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +3

      Don't tell anybody, but it's actually an artificial keyboard sound. 🫣
      It's an app called Klack.
      -Josh

    • @colin_cameron
      @colin_cameron หลายเดือนก่อน +1

      @@LaravelPHP can you avoid this for future videos, or at least turn the volume down? I had to stop the video as the sound was making me feel uneasy.

  • @helderneves91
    @helderneves91 หลายเดือนก่อน

    Good content Josh!

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +1

      Thank you for watching! :)
      -Josh

  • @hcivelek
    @hcivelek หลายเดือนก่อน +1

    Thank you! Very clear..

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +2

      Thanks for watching! :)
      -Josh

  • @kmbo_0
    @kmbo_0 หลายเดือนก่อน

    I use both as well but didn't had the clarification on which to use when, thanks for explaining.
    Also, which IDE & extensions are you using in video?

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +2

      Hey there! Thanks for watching and glad that it could be helpful in explaining it. :)
      This is VSCode with the TALL Stack plugin pack and PHP Intelephense (can't wait for the VSCode Laravel plugin).
      -Josh

  • @talisfang
    @talisfang หลายเดือนก่อน

    What is the font in the IDE?

  • @anishshortsvideo19
    @anishshortsvideo19 หลายเดือนก่อน

    Thank you

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +1

      Thanks for watching!
      -Josh

  • @victorvanrijn
    @victorvanrijn หลายเดือนก่อน +3

    Great tutorial videos, thanks. Could you please try to normalize or master your voice audio track in your future videos, because it currently sounds relatively soft, which requires some extra focus and volume to clearly understand your explanation. Nothing wrong with your content or attitude, thanks again for these Laravel related tutorials!

    • @LaravelPHP
      @LaravelPHP  หลายเดือนก่อน +1

      Hey there, I'll try to do better at fixing this in the future. I haven't gotten too many comments about it since some of the older videos weren't as good, but I'll try to keep an eye on it!
      -Josh

    • @pookiepats
      @pookiepats หลายเดือนก่อน +1

      @@LaravelPHPit’s just how you speak, you tend to drop your vocal inflection at the end of your sentences and interestingly when you look away from the camera but frankly it’s quite subtle and likely the original commenter’s hardware is more to blame than anything you’re doing.
      It’s definitely deep in the nitpick zone 😂
      Nice vid sir

    • @StrahilMinev
      @StrahilMinev หลายเดือนก่อน +1

      I don't want to sound like I invalidate your experience, but I find his voice very pleasant. Usually streamers talk too loud for my taste and his voice here I find very calming.

  • @onlinetechnology5015
    @onlinetechnology5015 หลายเดือนก่อน

    your vs code? font? family

  • @parijke
    @parijke หลายเดือนก่อน +9

    Nice video... Especially after 1 minute when the background "music" finally stopped. Don't use music when you talk please

    • @elijahcruz8895
      @elijahcruz8895 หลายเดือนก่อน +1

      Nothing wrong with having music in a video

    • @parijke
      @parijke หลายเดือนก่อน +1

      @@elijahcruz8895 when you have misophonia it is really annoying almost intolerable.

  • @MarkConstable
    @MarkConstable 23 วันที่ผ่านมา

    I can't watch this at x1.5+ speed because of the background music! Please do not use music after the intro.