npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@uxf/mailing

v11.117.2

Published

Email rendering utilities and build tools

Readme

@uxf/mailing

React-based email template renderer package for developing, building, and deploying email templates.

Package Structure

@uxf/mailing/
├── build-renderers.ts     # Production build script
├── dev-runner.tsx         # Development runner (used by PHP in dev mode)
├── renderer-entry.tsx     # Bundled entry point for each template
├── renderer-plugin.ts     # esbuild plugin for virtual entry points
├── responsive.tsx         # ResponsiveRow / ResponsiveColumn helpers
├── with-preview-props.tsx # Helper for dev server preview props
└── types.ts               # TypeScript definitions

Email Component Library

react-email v6 is declared as a peerDependency and is auto-installed by the UXF tooling — components and the render function are imported from a single package:

import { Body, Container, Head, Html, render, Tailwind, Text } from "react-email";

build-renderers.ts externalizes react-email, @react-email/render, and react so the bundled template .js resolves them from the consumer's node_modules at runtime instead of inlining them.

Responsive helpers (ResponsiveRow, ResponsiveColumn) used to come from @responsive-email/react-email; they live in this package now and are imported via @uxf/mailing/responsive — no extra install needed.

Project Structure (in consuming project)

api/
├── node_modules/@uxf/mailing/
├── templates/
│   └── react/                     # Email templates
│       ├── example/
│       │   ├── example-email.tsx  # Template implementation
│       │   ├── example-email.json # Preview data
│       │   └── example-email.js   # Built output (git-ignored)
│       └── tsconfig.json
├── tsconfig.json
└── package.json

Development Workflow

Creating a New Template

  1. Create the template file:
// templates/react/my-template.tsx
import { Body, Container, Head, Html, pixelBasedPreset, Tailwind, Text } from "react-email";
import { withPreviewProps } from "@uxf/mailing/with-preview-props";
import previewProps from "./my-template.json";

export function EmailComponent(props: { data: { title: string; message: string } }) {
    return (
        <Tailwind config={{ presets: [pixelBasedPreset] }}>
            <Html lang="cs">
                <Head><title>{props.data.title}</title></Head>
                <Body className="mx-auto max-w-[600px] p-5 font-sans">
                    <Container>
                        <Text>{props.data.message}</Text>
                    </Container>
                </Body>
            </Html>
        </Tailwind>
    );
}

export default function MyTemplate() {
    return withPreviewProps(EmailComponent, previewProps);
}
  1. Create the preview data file:
// templates/react/my-template.json
{
    "data": {
        "title": "My Email Template",
        "message": "Hello from my custom template!"
    }
}
  1. Build for production:
yarn renderers:build

Building for Production

yarn tsx node_modules/@uxf/mailing/build-renderers.ts --path templates/react

This command:

  • Finds all .tsx files in the specified path
  • Bundles each template with CLI rendering logic via esbuild
  • Outputs a .js file next to each template
  • react, react-email, and @react-email/render are external (resolved from project node_modules)

Parameters:

  • --path, -p: Path to templates directory (required)

Testing a Built Template

node templates/react/example/example-email.js '{"data": {"title": "Test", "note": "Hello"}}'

Development Mode (PHP)

In development, PHP calls templates directly via tsx without building:

tsx node_modules/@uxf/mailing/dev-runner.tsx templates/react/example/example-email.tsx '{"data": {...}}'

dev-runner.tsx dynamically imports the template's EmailComponent and renders it.

Environment Variables

Templates access environment variables at runtime:

<Img src={`${process.env.FRONTEND_URL}/assets/mailing/logo.png`} alt="Logo" />

Variables are loaded from the project's .env file.

Scripts Reference

| Command | Description | |---------|-------------| | yarn tsx @uxf/mailing/build-renderers.ts -p <path> | Build production bundles | | yarn tsx @uxf/mailing/dev-runner.tsx <template> <json> | Run a template in dev mode |

tsconfig Requirements

The consuming project's tsconfig.json must include the templates directory and set jsx: react-jsx:

{
    "compilerOptions": {
        "jsx": "react-jsx"
    },
    "include": ["templates/react/**/*.ts", "templates/react/**/*.tsx"]
}

Troubleshooting

React is not defined at runtime

The tsconfig.json include field does not cover the template files. Ensure templates/react/** is included.

Build failures

  • Ensure template files end with .tsx
  • Ensure each template exports EmailComponent as a named export and a default function
  • Run yarn typecheck to identify type errors