From 9fd22d977a12c79982066f86d012e89ed89df8e2 Mon Sep 17 00:00:00 2001 From: Febri Hidayan Date: Sun, 14 Jan 2024 21:45:05 +0700 Subject: [PATCH] add template usage document --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index ae8d671..3c9e3cc 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. \ No newline at end of file