Code review at scale is broken. Here’s how Augment Code is fixing it.

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
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech
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
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
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
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
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 →
Encrypt Files in Laravel with AES-256-GCM and Memory-Efficient Streaming image

Encrypt Files in Laravel with AES-256-GCM and Memory-Efficient Streaming

Read article
Statamic 6 Is Officially Released image

Statamic 6 Is Officially Released

Read article
Livewire 4 and Blade Improvements in Laravel VS Code Extension v1.5.0 image

Livewire 4 and Blade Improvements in Laravel VS Code Extension v1.5.0

Read article
Manage PostgreSQL Databases Directly in VS Code with Microsoft's Extension image

Manage PostgreSQL Databases Directly in VS Code with Microsoft's Extension

Read article
NativePHP for Mobile Is Now Free image

NativePHP for Mobile Is Now Free

Read article
Fuse for Laravel: A Circuit Breaker Package for Queue Jobs image

Fuse for Laravel: A Circuit Breaker Package for Queue Jobs

Read article