Download the PHP package mscode-pl/laravel-react-email without Composer

On this page you can find all versions of the php package mscode-pl/laravel-react-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-react-email

Laravel React Email

Build Laravel email templates using react-email components. Variables from your Mailable are injected at send-time via Laravel Blade — no static strings hardcoded into HTML.

Latest Version


How it works

The build step compiles your TSX to static HTML and replaces placeholder props with Blade expressions:

In template In compiled Blade
$$name$$ {{ $name }}
$$user.email$$ {{ $user['email'] }}
blade.number('price') + {price.toFixed(2)} {{ $price }}
<BladeForEach items="items"> @foreach($items as $item)
<BladeIf condition="fee > 0"> @if($fee > 0)

Installation

1. Composer

2. Publish config

3. npm dependencies

Install react-email and link the library from your vendor directory so TSX templates can import its helpers:

Then add to your project's package.json:

Run npm install once more to create the symlink:

Why? The package lives in vendor/ (Composer only, not published to npm). The file: reference lets tsx resolve import { blade } from '@mscode-pl/laravel-react-email' correctly.


Quick start

Generate a Mailable + template

Creates:

Write the template

resources/react-email/welcome-email.tsx:

Build

Send

app/Mail/WelcomeEmail.php:


Variables

Simple string variables

Use $$variableName$$ directly in JSX text. The build step converts them to {{ $variableName }}.

Compiled Blade output:

Nested object variables

Dot notation is converted to array access:

Compiled Blade output:

Numeric variables

Use blade.number('varName') so methods like .toFixed() work at build time without crashing:

Compiled Blade output:

Blade handles the actual number formatting at send-time with number_format($total, 2) etc.

Lists / arrays — <BladeForEach>

Use the <BladeForEach> component to loop over an array. Inside, write $$item.property$$ placeholders:

Compiled Blade output:

For nested arrays (e.g. order.items):

Compiles to:

Conditional sections — <BladeIf>

Use <BladeIf> to wrap content that should only appear when a condition is true:

Compiled Blade output:


blade() helper reference

Helper TypeScript type Use when
blade('name') any generic placeholder
blade.string('name') string plain text, no method calls
blade.number('name') number .toFixed(), arithmetic
blade.array<T>('name') T[] .map(), .filter(), .reduce()
blade.object<T>('name') T nested property access

Commands

Command Description
php artisan make:react-email <Name> Generate Mailable + TSX template
php artisan react-email:build Compile all templates to Blade views
php artisan react-email:dev Start live-preview server at localhost:3000

Configuration

config/react-email.php:


Requirements


License

MIT — see LICENSE.


All versions of laravel-react-email with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3|^8.4|^8.5
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mscode-pl/laravel-react-email contains the following files

Loading the files please wait ...