Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maen08/udictimailer
API to send bulk emails. Currently, is officially used by UDICTI, for UDICTI projects.
https://github.com/maen08/udictimailer
Last synced: 27 days ago
JSON representation
API to send bulk emails. Currently, is officially used by UDICTI, for UDICTI projects.
- Host: GitHub
- URL: https://github.com/maen08/udictimailer
- Owner: maen08
- Created: 2021-01-25T22:34:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-22T13:19:28.000Z (almost 3 years ago)
- Last Synced: 2023-08-17T04:27:58.205Z (over 1 year ago)
- Language: Python
- Homepage: https://udictimailer.gitbook.io/udictimailer/
- Size: 349 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UdictiMailer API
[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://github.com/maen08)
API that helps to send the multiple emails (currently, used only for UDICTI official projects). Easy to integrate in your project !
### INTRODUCTION
---
- #### Allowed HTTP requests:- GET - Get the list of resource
- POST - Update the resource- #### Description of some HTTP responses:
- `200 OK `- the request was successful
- `201 Created `- the request was successful and a resource was created.
- `400 Bad Request` - the request could not be understood or was missing required parameters.
- `401 Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- `403 Forbidden` - access denied.
- `404 Not Found` - resource was not found.##
##### ENDPOINTS
Endpoint | HTTP Method | Parameter | Description
| ------ | ------ | ------ | ------ |
| register/ | POST | `email`, `username`, `password` | Endpoint to register user. All parameters are required. Make sure you are using the same names even if in DOM (HTML elements eg. name="email")
| login/ | POST | `username`, `password` | Pass the same username and password which used to register a particular user. Any other different parameter will result an error. Successful logged in user will obtain `token`
| test/ |GET | NULL | This is the endpoint just to test your `token` and all setup if everything works fine. You must get `200 OK` response
| send/ | POST | `email-subject`, `email-body`, `email-receiver` | The endpoint that sends email. Pass the parameters required and the `token` to send emails.##
##### DATA TYPES OF PARAMETERS
---
- email `(String)` : Unique email per user
- username `(String)` : Unique username per user
- password `(String)` : Adviced to be strong password
- email-subject `(String)`: The subject of email
- email-body `(String)`: The body itself
- email-receiver `(String)`: Receiver's emails. May be multiple emails separated by a comma (,)##
##### ENDPOINT TESTS
---
You can test the endpoints and HTTP requests using any tool (Postman, being so common) that you're comfortable with. This documentation uses `requests` (a Python package) to perform some of the methods, just to give an example.Feel free to use any language with any technology during testing.
##### Registration endpoint (register/)
```sh
import requestsurl = 'http://udictimailer.herokuapp.com/register/'
data = {
'email': '[email protected]',
'username': 'username-here',
'password': 'password-here',
}r = requests.post(url, data=data)
print(r.status_code)
print(r.reason)
print(r.content)
```##### Login endpoint (login/)
```sh
import requestsurl = 'http://udictimailer.herokuapp.com/login/'
data = {
'username': 'username-here',
'password': 'password-here',
}r = requests.post(url, data=data)
print(r.status_code)
print(r.reason)
print(r.content)# At this endpoint, you obtain token
```##### Send email endpoint (send/)
```sh
import requestsurl = 'http://udictimailer.herokuapp.com/send/'
headers = {'Authorization': 'Token '}data = {
'email-receiver': '[email protected], [email protected], [email protected]',
'email-subject': 'Sent from API',
'email-body': 'Hello UdictiMailer',
}r = requests.post(url, data=data, headers=headers)
print(r.status_code)
print(r.reason)
print(r.content)
```
### Technologies
- Django
- Django Rest Framework
- [Djangoroku](https://pypi.org/project/djangoroku/)
- Heroku### Todos
- Write MORE Tests
- More documenting
- Add more functionalities depending on developer's requirements
License
----MIT