4,000 emails/month for free | Mailtrap sends real emails now!

Laravel News Digest – Behind the Scenes

Published on by

I’ve been writing a weekly Laravel newsletter for 6 weeks now. Every week I try to share a personal story, Laravel tip, or some form of story that’s on my mind. I also include a list of posts, random web links, quotes, and other things. Here is a full archive if you want to see them.

In this post I wanted to share how I create these. At the start I created each one by hand, and by hand I mean I literally copy and pasted html tables all over the place and after I finally felt I had some sort of structure I would spend another hour or two making sure it worked in every mail client my devices support.

Design

I’m a big fan of minimal sites. I like the cleanliness and the focus on the fonts and words. More so than images and graphics. Of course with email you can’t get very fancy anyway or you could be in a world of hurt. I decided to go with a very clean response white and grey layout. I don’t have any stats to back this up but my thoughts are since I send these on a Sunday most of my readers will receive it on a mobile device, so having a minimal responsive theme was important.

For the template I used Zurb email templates and just went with their basic example. One nice thing I did come across however is that you can use custom fonts in email with a few caveats. You can use Google fonts, or you can use your own if you purchase the font and import into CSS. In my case I just picked two from Google, Lato and Oswald, and went with it. I’ll be honest I’m not sure how widely these are supported but they worked on all my devices, plus I used the good old fashioned fallbacks of Arial and Helvetica.

Another trick is to import the css file directly into the template. This way when you copy and paste into an inliner, it can pull styles from the source. Here is a simple way in blade:

<style type="text/css">
{{ include(public_path().'/css/newsletter.css') }}
</style>

HTML

I finally got fed up with the process of copy and pasting blocks of html tables and decided to make it better, and when I say better I mean better for me. You might think this is all dumb. :) The first step was getting away from HTML as much as possible. Nested tables are brutal without Dreamweaver and I’m not going down that path. I do love markdown and that’s what I wanted to write in. This gives me lots of benefits and my workflow is simple. Each week I create a new file and throughout the week I add to it anything I find interesting: notes, links, quotes, etc.

I then take the finished markdown file and parse it. I follow this structure in my file:

first section
 
--break--
 
second section
 
--break--
 
--posts-- <- This tag gets converted to a list of posts
 
--break--

With this I just “break” apart each section, run it through markdown, and then loop it in a view:

@section('content')
@foreach ($contents as $section)
@if (trim(strip_tags($section)) == '--posts--')
@include(theme_view('newsletter.inc.posts'))
@else
@include(theme_view('newsletter.inc.section-start'))
{{ $section }}
@include(theme_view('newsletter.inc.section-end'))
@endif
@endforeach
@stop

The finished parsed file is then ready for me to go through as many times as I need. I read and re-read these way more than I should. I pretend I’m a sniper with only one shot, so I strive to make it the best I can.

Once I’m comfortable with all the text then all that is left is to view source, copy and paste into the inliner, and schedule it for Sunday afternoon in my newsletter system.

Stats

To share a few stats so far I am getting around an 80% open rate with 1% unsubscribes. I’ve heard from a few sources that the bigger the list grows the open rate will typically decrease to around 50%, and the 1% is average. So I’m overall happy with my first few weeks into this experiment.

When I started this I never imagined the time and effort that I would put into it. Thinking about it now I should have just imported a list of this weeks posts, sent those, and be done. :)

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Cache Without Overlapping in Laravel 12.47.0 image

Cache Without Overlapping in Laravel 12.47.0

Read article
Going Real-Time with Reverb - Laravel In Practice EP17 image

Going Real-Time with Reverb - Laravel In Practice EP17

Read article
PHP DebugBar v3 is released image

PHP DebugBar v3 is released

Read article
The Neuron AI Framework for PHP and Laravel image

The Neuron AI Framework for PHP and Laravel

Read article
What's new in Filament v4.5? image

What's new in Filament v4.5?

Read article
Manage Waitlists in Laravel with Laravel Waitlist image

Manage Waitlists in Laravel with Laravel Waitlist

Read article