johnnyxlemonade/email-generator

Lemonade Email Generator

Email Generator composes HTML email from immutable documents and typed components. It integrates with Lemonade configuration, localization and the service container.

What it does

Compose with components

Build a document from headings, text, tables, buttons, columns, alerts and attachment lists. The renderer turns those components into a complete HTML email.

  • Immutable documents with a fluent API
  • Components for text, tables, columns, buttons and attachments
  • Formatted text and links without raw HTML
  • Configurable width, colors and typography
  • Localization through Lemonade translation catalogs

Generation, not delivery

The package returns HTML. MIME messages, email transport, queues and physical attachments remain the application’s responsibility.

In practice

In practice

Create a document, add headings, text, tables, attachment lists or buttons, then call render(). Your application passes the resulting HTML to its own email transport.

PHP / email-generator
<?php

$html = $emails
    ->create(locale: 'en', title: 'Welcome', preheader: 'Your account is ready.')
    ->heading('Welcome')
    ->text('Thank you for signing up.')
    ->button('Activate account', 'https://example.com/activate')
    ->render();
Installation

Installation

Install the package with Composer. Its README covers any migrations and permission setup.

COMPOSER
composer require johnnyxlemonade/email-generator:dev-main

Required packages

  • johnnyxlemonade/framework