Skip to content

Commit

Permalink
add template usage document
Browse files Browse the repository at this point in the history
  • Loading branch information
febrihidayan committed Jan 14, 2024
1 parent 32961f3 commit 9fd22d9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Started rest API with clean architecture monorepo golang
- [Installation](#installation)
- [With Docker](#with-docker)
- [Port HTTP and RPC Services](#port-http-and-rpc-services)
- [Docs Services](#docs-services)
- [Notification Service](#notification-service)

## Required
1. [Golang](https://go.dev/) v1.21.5 or above
Expand All @@ -30,3 +32,45 @@ Started rest API with clean architecture monorepo golang
| user | 8084 | 9084 |
| storage | 8085 | 9085 |
| notification | 8086 | 9086 |

## Docs Services
Here I will provide the information that the service needs to set some default configurations.

### Notification Service
In the notification service you must store templates for email and FCM needs, here I will provide sample data from the database. You can modify as you wish, you need to know that the use of email and FCM templates must be different. If they are the same then the concept of both must be the same as the welcome template.

**Welcome**:
```json
{
"_id": "458c523a-b5a0-4ca0-9915-b389bae31770",
"name": "welcome",
"type": "email",
"data": "{"body":{"en":"Hi {{.name}}, you have become one of us.","id":"Hai {{.name}}, kamu telah menjadi bagian dari kami."},"title":{"en":"Welcome","id":"Selamat Datang"}}",
"created_at": "2024-01-11T07:52:59.953+00:00",
"updated_at": "2024-01-11T07:52:59.953+00:00"
}
```

**Email Verified**:
```json
{
"_id": "80faa307-7f5d-4c2c-9d66-05f77641b161",
"name": "email-verified",
"data": "{"link":{"en":"{{.link}}","id":"{{.link}}"},"title":{"en":"Verify Email Address","id":"Verifikasi Alamat Email"}}",
"created_at": "2024-01-11T07:52:59.953+00:00",
"updated_at": "2024-01-11T07:52:59.953+00:00"
}
```

**Password Reset**:
```json
{
"_id": "2adbcd01-ae67-491e-a95d-72faa78cd246",
"name": "password-reset",
"data": "{"expire":{"en":"{{.expire}}","id":"{{.expire}}"},"link":{"en":"{{.link}}","id":"{{.link}}"},"title":{"en":"Reset Password Notification","id":"Pemberitahuan Reset Kata Sandi"}}",
"created_at": "2024-01-11T07:52:59.953+00:00",
"updated_at": "2024-01-11T07:52:59.953+00:00"
}
```

> You can add templates via endpoint `/v1/notification/template`.

0 comments on commit 9fd22d9

Please sign in to comment.