• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    Rust
  • License
    GNU Affero Genera...
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

Rust implementation of catapulte email sender

Catapulte

Build Status codecov

Docker Pulls Docker Image Size (latest by date)

What is catapulte?

Catapulte is an open source mailer you can host yourself.

You can use it to quickly catapult your transactionnal emails to destination.

Deploy

Why did we build catapulte?

Catapulte comes from the frustration of using several email providers. We used to work with products like sendgrid, mailgun, mailchimp, sendinblue, etc.

But they have many disadvantages :

  • Most of them are not really transactionnal oriented, and users complain that their login emails take a long time to arrive.
  • You cannot host it nor use it on premise
  • It's American, with the patriot act, they are able to access your users data.
  • They usually don't have templating tools for our non tech coworkers that ask us to change a wording every 2 days. And when they do, the editors are like html online editors, so it ends up being our job to make the template anyway.

How to use it?

Catapulte is a simple service that renders your mjml template, interpolates the data and then sends it to a SMTP server. If you want to see how to create your own template, take a look at the /template folder in this repository.

You then have several options for starting catapulte. We recommend using Docker if you are on a amd64, i386 or arm64v8 architecture. By doing the following, you'll be able to have a running server that will render and send your email.

docker run -d \
  --name catapulte \
  -e SMTP__HOSTNAME=localhost \
  -e SMTP__PORT=25 \
  -e SMTP__USERNAME=optional \
  -e SMTP__PASSWORD=optional \
  -e SMTP__TLS_ENABLED=true \
  -e SMTP__ACCEPT_INVALID_CERT=false \
  -e TEMPLATE__TYPE=local \
  -e TEMPLATE__PATH=/templates \
  -p 3000:3000 \
  -v /path/to/your/templates:/templates:ro \
  jdrouet/catapulte:latest

Once your server started, you can simply send an email using an HTTP request.

curl -X POST -v \
  -H "Content-Type: application/json" \
  --data '{"from":"[email protected]","to":"[email protected]","params":{"some":"data"}}' \
  http://localhost:3000/templates/the-name-of-your-template/json

You can also send attachments using a multipart request.

curl -X POST -v \
  -F attachments=@asset/cat.jpg \
  -F [email protected] \
  -F [email protected] \
  -F params='{"some":"data"}' \
  http://localhost:3000/templates/user-login/multipart

You can configure it with some environment variable and can find more information in this wiki.

If you some API specification, the Open API specification is also available on /openapi.json when Catapulte is running.

To use it in production, we prepared a documentation on how to use Catapulte with Amazon Simple Email Service.

Sending to multiple recipients

You can send the same email to multiple recipients just by using an array in the to field, like this:

curl -X POST -v \
  -H "Content-Type: application/json" \
  --data '{"from":"[email protected]","to":["[email protected]","[email protected]"],"params":{"some":"data"}}' \
  http://localhost:3000/templates/the-name-of-your-template/json

Should you use it?

If, like us, you didn't find any good way of doing transactionnal emails, then YES!

Why you should use it :

  • You work in a startup

    • You don't have shit loads of money to spend on the mailing tools, so use something opensource, send your emails from your own SMTP (or from Amazon SES, it's cheap)
    • You don't have time to change the email template everyday, so let your Product Owner do it
    • You wanna be able to add this little feature, just do a pull request...
  • You work in a big company

    • You cannot use those external services because you're not allowed to put your user's data on an external service.
    • You cannot access external services because it's blocked by the proxy
    • You want to customise the way you authenticate to your SMTP
    • You want something user friendly enough that your manager can write the emails

Thank you!

Buy Me A Coffee

More Repositories

1

mrml

Implementation of mjml in rust
HTML
350
star
2

jolimail

Send nice emails
TypeScript
135
star
3

docker-activity

Tool to monitor the statistics and the energy consumption of docker containers
Rust
55
star
4

git-metrics

A git extension to be able to track metrics about your project, within the git repository
Rust
35
star
5

magic-link-example

JavaScript
31
star
6

ferris-emoji

Set of ferris emojis 🦀
31
star
7

docker-on-ci

Examples of how to use docker on different CIs
Makefile
29
star
8

loopback-component-storage-mongo

A loopback component storage to store in mongo
CoffeeScript
29
star
9

docker-with-buildx

Docker image with buildx preinstalled
Dockerfile
16
star
10

tmdb-api

Yet another TMDB api client written in rust, working with async
Rust
13
star
11

tekitoi

A lightweight and easy to use oauth2 proxy
Rust
13
star
12

loopback-component-storage-postgres

LoopBack storage postgres component provides Node.js and REST APIs to manage binary contents using Postgres Large Object
CoffeeScript
11
star
13

expo-image-cache-example

JavaScript
10
star
14

awesome-docker-cli-plugins

😎 Awesome lists of docker cli plugins
9
star
15

serde-toml-merge

Merge your toml configurations in rust
Rust
7
star
16

manteau

Just an alternative to Jackett, but fast and light 🧥
HTML
6
star
17

loopback-component-sqlizer

Component to add sql methods to models
CoffeeScript
6
star
18

traduit

Traduction tool
JavaScript
5
star
19

postgres-querybuilder

A query builder for postgres written in Rust
Rust
5
star
20

dockerfiles

Shell
5
star
21

pcloud

Rust client for pCloud API
Rust
4
star
22

mrml-editor

A component to edit mjml in the browser
TypeScript
4
star
23

action-git-metrics

Github action for git-metrics
4
star
24

article-queue-like-a-boss

JavaScript
3
star
25

powercap

Rust crate that helps read powercap data
Rust
3
star
26

opencv-wasm

Try to build opencv in wasm, just keeping what I need
C++
3
star
27

rusty-board

It's like Trello, but written in rust and open source.
2
star
28

docker-bug-value-too-long

Reporting a docker buildx bug
Rust
2
star
29

datadog-client

Rust implementation of a client to the datadog api
Rust
2
star
30

kaamelott-quote

JavaScript
1
star
31

deadpool-lettre

This crate implements a deadpool manager for lettre
Rust
1
star
32

webapp-gulp-builder

CoffeeScript
1
star
33

jolimail.io

landing page for jolimail
TypeScript
1
star
34

tiny-vector

Just an experiment of rewriting vector, from scratch, without looking at the code, for fun and learning.
Rust
1
star
35

mini-agent

Almost like Vector but not really
Rust
1
star
36

quiestce

Simple oauth mock written in Rust
Rust
1
star
37

mailbunny

Forward the email ✉️ you receive to a rabbitmq exchange 🐰
JavaScript
1
star
38

normal-it

Normalizes and denormalizes JSON according to relational schema
JavaScript
1
star
39

emscripten-images

Images of emscripten modules
Dockerfile
1
star
40

kind-testing

Trying to run containers, in kubernetes, inside a container 🤯
Shell
1
star
41

rust-bench

Should I do it this way or that way? Write a bench!
Rust
1
star
42

mouchard

Microservice to know if the recipient opened your email
Rust
1
star
43

opengraph-html-webpack-plugin

Let wepback generate all your opengraph informations for you
JavaScript
1
star
44

loopback-presentation

HTML
1
star
45

expo-image-cache

JavaScript
1
star
46

donos

Like Pi-Hole but without many things (like the UI) and written in Rust
Rust
1
star
47

docker-gatsby

Image to build gatsby project
Makefile
1
star
48

tokio-postgres-migration

Library to run migrations
Rust
1
star
49

htmlparser

Rust
1
star