PHPackages                             gbielbarbosa/react-email-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gbielbarbosa/react-email-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gbielbarbosa/react-email-php
============================

A PHP library to parse Tiptap JSON from @resend/react-email editor into HTML

1.0.0(1mo ago)00MITPHPPHP &gt;=8.1

Since Apr 25Pushed 1mo agoCompare

[ Source](https://github.com/gbielbarbosa/react-email-php)[ Packagist](https://packagist.org/packages/gbielbarbosa/react-email-php)[ RSS](/packages/gbielbarbosa-react-email-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

react-email-php
===============

[](#react-email-php)

[![Minimum PHP Version](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](LICENSE.md)

A PHP 8.1+ library designed to parse and render Tiptap JSON outputs generated by [Resend React Email Editor](https://react.email/editor) into valid, email-safe HTML. It translates modern editor structures into cross-client compatible HTML tables.

Version Compatibility
---------------------

[](#version-compatibility)

This package processes JSON from the Resend React Email Editor. Please ensure you use compatible versions:

`react-email-php``@react-email/editor`PHP Version`1.x.x``^1.0.0``>= 8.1`Installation
------------

[](#installation)

You can install the package via composer:

```
composer require gbielbarbosa/react-email-php
```

Usage
-----

[](#usage)

### Converting JSON to Email-Safe HTML

[](#converting-json-to-email-safe-html)

To parse the JSON output from your front-end editor and render it as email-safe HTML, use the `toHtml` method. This method automatically handles layout components (Sections, Containers, Columns), mapping them to `` tags to ensure Outlook, Apple Mail, and Gmail compatibility.

```
use ReactEmail\EmailParser;

$json = '{"type":"doc","content":[{"type":"body","content":[{"type":"container"}]}]}';

$parser = new EmailParser();
$html = $parser->toHtml($json);

echo $html;
```

The resulting `$html` will automatically include the proper HTML boilerplate (``, ``, ``) if it's not present, and will dynamically inject any global styles defined in your editor's `globalContent` node.

### Sanitizing JSON for Storage

[](#sanitizing-json-for-storage)

Before saving the raw editor output to your database, you should sanitize it to prevent CSS/XSS injection payloads. The `toJson` method recursively traverses the JSON tree and strips invalid or malicious CSS values.

```
use ReactEmail\EmailParser;

// Raw JSON directly from the user's request
$rawJson = $_POST['editor_json'];

$parser = new EmailParser();
$safeJson = $parser->toJson($rawJson);

// $safeJson is now clean and ready to be stored in your database
```

Features
--------

[](#features)

- Pure PHP implementation.
- Native rendering of complex layout components into responsive HTML tables.
- Deep integration with the Tiptap structure.
- Parses and injects global styles (from the `globalContent` node) directly into the corresponding body and container elements.

Supported Extensions
--------------------

[](#supported-extensions)

This library includes native support for the following **Resend React Email Editor** extensions:

- Layout blocks: `Body`, `Container`, `Section`, `Columns`, `ColumnsColumn`, `Div`
- Text elements: `Heading`, `Paragraph`, `Blockquote`, `CodeBlock`
- Media &amp; UI: `Button`, `Img`, `Divider`
- Tables: `Table`, `TableRow`, `TableCell`, `TableHeader`
- Lists: `BulletList`, `OrderedList`, `ListItem`
- Inline Marks: `Bold`, `Italic`, `Strike`, `Underline`, `Code`, `Sup`, `Uppercase`, `Link`

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7bc037955a0b761fe9053871c458dc72e82c3e37b3844d7d3a3be592ae616c1b?d=identicon)[gbielbarbosa](/maintainers/gbielbarbosa)

---

Top Contributors

[![gbielbarbosa](https://avatars.githubusercontent.com/u/76674028?v=4)](https://github.com/gbielbarbosa "gbielbarbosa (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gbielbarbosa-react-email-php/health.svg)

```
[![Health](https://phpackages.com/badges/gbielbarbosa-react-email-php/health.svg)](https://phpackages.com/packages/gbielbarbosa-react-email-php)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M901](/packages/statamic-cms)[yourls/yourls

Your Own URL Shortener

12.1k27.8k1](/packages/yourls-yourls)[filament/forms

Easily add beautiful forms to any Livewire component.

4728.4M376](/packages/filament-forms)[verbb/vizy

A flexible visual editor field for Craft.

4249.7k](/packages/verbb-vizy)[ph-7/qrcode-generator-php-class

Light QRCode PHP class (library). QR Code Generator using vCard 4.0 and the Google Chart AP

10415.7k2](/packages/ph-7-qrcode-generator-php-class)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
