Mailcoach v2 has been released with support for custom HTML editors and multiple mailers

Original – by Freek Van der Herten – 9 minute read

A couple of months ago, my team released Mailcoach, a self-hosted solution to send out newsletters. It sends out mail via services like Amazon SES, Mailgun, Sendgrid, and Postmark. It can optionally track opens and clicks. When your email list grows, this is a much more cost-effective solution when compared to a service like Mailchimp.

Mailcoach can be used as a premium Laravel package or as a stand-alone app. When installed into a Laravel app, it can be greatly customized. The Mailcoach stand alone app can be used without knowing how to program.

Today we're releasing v2 of Mailcoach. It offers support for Laravel 7, html editors, and multiple mailers, together with a bunch of quality of life improvements. In this blog post, I'd like to walk you through these features and show some technical details.

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

How to refactor complex if statements

Original – by Freek Van der Herten – 1 minute read

Have you every come across confusing if statements with complex conditionals such as this? I bet you did!

// please kill me 🤯 
if (!(($this->shipping_country == "GB" || (strcmp($this-status, "Valid") !== 0)) {

To me, this is completely unreadable.

In the video below I show how I deal with this situation. Spoiler: add some tests around it and break the conditionals apart.

This video is part of the Mailcoach video course. It contains many more videos on how to write clear code. You can use this coupon code to get a nice discount of $10.

YES-I-WANT-TO-WRITE-READABLE-CODE

Read more

Laravel Tail can now tail remote logs

Original – by Freek Van der Herten – 2 minute read

laravel-tail is one of my favourite packages. When installed in a Laravel app it can be used to tail the log file. To tail a log file locally, you just have to issue this command: php artisan tail and it'll start tailing the latest log file (so it works for both daily and single log files). Any line…

Read more