onasty/mailer/README.md (view raw)
| 1 | # mailer service |
| 2 | |
| 3 | All templates could be found *[here](./template.go)* |
| 4 | |
| 5 | ## endpoints |
| 6 | ### `mailer.ping` |
| 7 | This endpoint always returns pong message |
| 8 | |
| 9 | Response: |
| 10 | ```json |
| 11 | { |
| 12 | "message": "pong" |
| 13 | } |
| 14 | ``` |
| 15 | |
| 16 | ### `mailer.send` |
| 17 | |
| 18 | Input |
| 19 | - `request_id` : *string* - (optional) the request id, needed to keep consistency across services |
| 20 | - `receiver` : *string* - the email receiver |
| 21 | - `template_name` : *string* - the template that's going to be used |
| 22 | - `options` : *Map<string, string>* - template specific options |
| 23 | |
| 24 | |
| 25 | Example input |
| 26 | ```json |
| 27 | { |
| 28 | "request_id": "hello_world", |
| 29 | "receiver": "onasty@example.com", |
| 30 | "template_name": "email_verification", |
| 31 | "options": { |
| 32 | "token": "the_verification_token" |
| 33 | } |
| 34 | } |
| 35 | ``` |
| 36 | |
| 37 | #### Template specific options |
| 38 | - `email_verification` |
| 39 | - `token` the token that is used in verification link |