all repos

onasty @ eb4c60509f134e49485bff1ee0c6422ced9d5e03

a one-time notes service

onasty/mailer/README.md (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
feat(api): change email (#191)..., 9 months ago
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
40
- `reset_password`
41
  - `token` the token that is used in password reset link
42
- `confirm_email_change`
43
  - `email` the email user want to set as new
44
  - `token` the token that is used in confirm link