Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Getting deep into Laravel mailables

337 views

Published on

In this talk, Vanessa Osuka talks on how to use Laravel mailables like a boss in your application workflow.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Getting deep into Laravel mailables

  1. 1. Laravel Mailables Vanessa Osuka | Laravel Nigeria Meetup
  2. 2. Software Developer at LadyLabs @VanessaOsuka Ijebusoma
  3. 3. What we’ll cover • Implementing Laravel Mailables • Leveraging Markdown Mailables • Email Layout Testing
  4. 4. What are Mailables?
  5. 5. Mailables are dedicated PHP classes for sending mails in your Laravel application.
  6. 6. Sub class AppMail Base class IlluminateMailMailable Extends
  7. 7. How do I generate a Mailable class? php artisan make:mail <classname>
  8. 8. MAILABLE CLASS Mail Class
  9. 9. CONTROLLER
  10. 10. VS
  11. 11. CONTROLLER
  12. 12. ‘Clean code is simple and direct, Like well written prose, it’s a blend of crisp abstractions and straightforward lines of control.’ –GradyBooch,authorofObjectOrientedAnalysisandDesignwithApplications
  13. 13. Illuminatemailmailable
  14. 14. Mail::to($email)->queue(new Download);
  15. 15. How Do I Pass Data From Controller To Mailable? Every public property in the mail class is automatically made available to your view.
  16. 16. Mail Class
  17. 17. MAILABLE PROS Decoupled Concise Flexible
  18. 18. What’s new in Laravel Mailables?
  19. 19. Markdown Mailables + Markdown Laravel Blade
  20. 20. Generating Markdown Mailables php artisan make:mail ConfirmationMail --markdown emails.order
  21. 21. return $this->markdown(‘email.confirm’);
  22. 22. Publishing and Customizing Markdown components php artisan vendor:publish –tag=laravel-mail
  23. 23. Laravel 5.5 • php artisan migrate:fresh • php artisan preset(None, Bootstrap, Vue, React) • Automatic package discovery • Email Layout Testing
  24. 24. Email Layout Testing?
  25. 25. Review emails right in your browser!
  26. 26. Thank you

×