API Endpoint: /api/send/
POST Request
This API endpoint allows you to send bulk or single emails using templates.
{ "from_email": "[email protected]", "subject": "this is a test from bulk html", "emails": [ { "email": "[email protected]", "context": {"name": "Jonathan", "last_name": "Lloyd"} }, { "email": "[email protected]", "context": {"name": "Info"} } ], "template": 579, "type": "bulk" }
{ "from_email": "[email protected]", "subject": "Here's your invoice", "emails": ["[email protected]"], "template": 98, "type": "single", "context": { "name": "Jonathan", "last_name": "Lloyd", "inv_num": "246534743", "items": [ { "name": "Water bottle", "qty": 3, "price": 11.97, "url": "example/url" }, { "name": "Plates", "qty": 5, "price": 19.96, "url": "example/url" } ], "total": 31.93 }, "test": true }
Endpoint URL
https://simplebulkemailer.app/api/send/
Additional information
To each payload, you can add the "test": true flag. This will avoid logging the email, useful for sending test emails.
Payload Breakdown
Header
- Bearer Token Your API key found on your dashboard "Bearer [your_token]"
Body
- from_email This is the email you set in your outgoing email in (outgoing mail server) on the dashboard
- subject Subject of your email
- emails This must always be a list of emails. Single must be a list of string and bulk needs to be a list of objects. (See payload examples)
- template This can be HTML or a pk of a template you created on the system
- type This determines single or bulk to be sent. This must match with the emails
- context The data to be rendered within your template
- test This is just a flag to determine. If set true a log won't be created. This is also not requered, but if it is not in it will defualt to false
Note: Bulk auto adds unsubscribe at the bottom of the email.
Templates & API Power
If you're familiar with the Django templating language, you can start creating dynamic templates quickly.
Visual Examples
Template Appearance
This shows how the email template looks when rendered using the Django templating system.
Client View
This shows how the template will appear on the client’s side when they receive the email.