TOPIC COLLECTION
Mail.
A collection of 7 practical ideas to make everyday Laravel work a little smoother.
07 TIPS01Testing Email into Laravel.logIf you want to test email contents in your app but unable or unwilling to set up something like Mailgun, use .env parameter MAIL DRIVER=log and all the…Mail02You Don’t Have to Store Files to Use Them as Email Attachments in LaravelSimply use attachData to add user uploaded files in Mailables. Here's a snippet from a Mailable class using it.Mail03Preview MailablesIf you use Mailables to send email, you can preview the result without sending, directly in your browser. Just return a Mailable as route resultMail04Preview Mail without MailablesYou can also preview your email without Mailables. For instance, when you are creating notification, you can specify the markdown that may be use for your…Mail05Default Email Subject in Laravel NotificationsIf you send Laravel Notification and don't specify subject in toMail() , default subject is your notification class name, CamelCased into Spaces.Mail06Send Notifications to AnyoneYou can send Laravel Notifications not only to a certain user with $user- notify() , but also to anyone you want, via Notification::route() , with so-called…Mail07Set Conditional Object PropertiesYou can use the when() or unless() methods in your MailMessage notifications to set conditional object properties like a call to action.Mail