Crates.io | catapulte |
lib.rs | catapulte |
version | 1.0.0 |
source | src |
created_at | 2024-01-04 10:08:32.007504 |
updated_at | 2024-03-05 08:38:52.286398 |
description | Catapulte is an open source mailer you can host yourself. You can use it to quickly catapult your transactionnal emails to destination. |
homepage | |
repository | |
max_upload_size | |
id | 1088321 |
size | 968,891 |
Catapulte is an open source mailer you can host yourself.
You can use it to quickly catapult your transactionnal emails to destination.
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 :
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":"alice@example.com","to":"bob@example.com","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 from=alice@example.com \
-F to=bob@example.com \
-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.
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":"alice@example.com","to":["bob@example.com","jon@example.com"],"params":{"some":"data"}}' \
http://localhost:3000/templates/the-name-of-your-template/json
If, like us, you didn't find any good way of doing transactionnal emails, then YES!
You work in a startup
You work in a big company