• Stars
    star
    350
  • Rank 117,746 (Top 3 %)
  • Language
    TypeScript
  • Created about 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Building the future of email with JSX syntax

JSXMail

jsx-mail-comparation

jsx-mail is an email framework that uses React to create email templates. Using JSX syntax makes it extremely easy to code your template, allowing you to create highly customized emails and reducing code maintenance work. Also, the main purpose of jsx-mail is to make your email templates compatible with all email clients.

Usage

JSX works with 2 different sides. The first side is what we call "jsx-side" this is the part where you should define the jsx/tsx content for your email template. The second side is called the "js-side" this is the side of your api (or whoever needs the HTML of the email).

// jsx-side
export function Welcome({ name }) {
  return <h1>{name} Welcome to jsx-mail</h1>;
}

export default function App() {
  return {
    Welcome: {
      componentFunction: Welcome,
      props: {
        name: 'string',
      },
    },
  };
}
// js-side
import { render } = from 'jsx-mail';
const template = await render('Welcome', { name: 'John' });

console.log(template) // <html>...<h1>John Welcome to jsx-mail</h1>...</html>

Documentation

See the documentation here

Why use jsx-mail?

If you've ever needed to create email templates, you know how complex it can be, from having to host the image on a separate server to a footer that appears overlaying the main button. So why use jsx? Because it solves all that for you! But ok, if you're still not convinced, here's a list of perks:

  • Simple Code
<!-- html -->

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Button</title>
  </head>
  <body>
    <table>
      <tr>
        <td>
          <a style="background-color: red" href="https://example.com">
            I'm a button
          </a>
        </td>
      </tr>
    </table>
  </body>
</html>
// jsx-mail
import { Button } from 'jsx-mail/components';
import styled from 'styled-components';

export function MyButton({ children }) {
  return <ButtonStyled>{children}</ButtonStyled>;
}

const ButtonStyled = styled(Button)`
  background-color: red;
`;

Which of these two codes can you understand faster? I believe the second, because the power of jsx is very big when it comes to simplifying codes and making them easier to understand. So this is what jsx-mail brings for creating email templates, all the power of JSX.

  • Compatibility with email clients

jsx-mail improves email template compatibility. This means that email templates created with JSX-Mail will display correctly in all email clients, including the most popular ones like Gmail, Yahoo! Mail and Outlook. What it does is block the use of some html tags or css attributes which are not accepted in email clients.

  • Simplified Development

With the jsx-mail cli (tool included in jsx-mail) you can simplify the development process, since you can use the serve command for jsx to start an application that simulates an email client.

More Repositories

1

tiktoker

Who said only humans can be tiktoker? ๐Ÿ˜ฒ
TypeScript
7
star
2

trailers-download

A powerful script that explores popular platforms like Netflix, Apple TV, Prime Video and more and downloads movie and series trailers in high resolution.
JavaScript
6
star
3

4devs

Validate and generate various data ๐Ÿš€โœ…
TypeScript
5
star
4

instarank

Earn up to 10,000 followers per month on Instagram with a subscription๐Ÿ“ฏ
TypeScript
4
star
5

instagrammer

Who said that only humans can have Instagram pages? ๐Ÿ˜ฒ
TypeScript
4
star
6

gender-name

An API that uses artificial intelligence to predict someone's gender based on their name
TypeScript
2
star
7

insta-rank

Sorts posts from an Instagram account in descending order of likes and comments. So you can analyze and design a content strategy based on real data from competitors or players in the same niche.
TypeScript
2
star
8

pro-marketing-free

a free social media marketing system created with Node.js and Angular
TypeScript
1
star
9

botcles

API articles that will make you a programmer.
TypeScript
1
star
10

PDF-creator

this is a robot that is capable of creating professional PDFs. and already know! you just need a related term or PDF content!
JavaScript
1
star
11

theryston.com

A programming blog made for those who don't have time to read blogs
JavaScript
1
star
12

db-mycro

A node module with a json database that saves data in a specific directory, similar to sqlite, but in JSON
TypeScript
1
star
13

learn-ai-gender

A project made to train a machine learning model to identify a person's gender by name
JavaScript
1
star
14

Morbin

a coding system that transforms a text into an array with binary numbers arranged in a specific sequence for each character
JavaScript
1
star
15

basic-blog

this is a blog created in node.js and MySQL which has an administration page and it can only be accessed by administrators
JavaScript
1
star
16

fillscene

Fillscene is a platform for watching movies and TV shows for free.
TypeScript
1
star
17

hlsfy

This is an extremely simple open source API with a single objective: transforming any video format into HLS
TypeScript
1
star
18

myself

Myself uses AI and Fine Tune to create a digital version of you, capable of interacting on WhatsApp and other platforms as if it were you.
JavaScript
1
star
19

comandotorrent.info-indexer

Index all content from https://comandotorrent.info to a sqlite3 file
TypeScript
1
star
20

trailers-api

A API that downloads movie and tv shows trailers in high resolution from services like Netflix, Apple TV, Prime Video and more
JavaScript
1
star
21

title-downloader

Use this tool to search and download movies and series with transmission (all from Brazilian torrent servers).
TypeScript
1
star