Skip to content

Commit 1a4ae0e

Browse files
authored
Update README.template.md
1 parent 3c09f73 commit 1a4ae0e

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/templates/README.template.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ endpoint restrictions, placeholders, and flexible configuration.
3131
- [Getting Started](#getting-started)
3232
- [Setup](#setup)
3333
- [Usage](#usage)
34-
- [Best Practices](#security-best-practices)
34+
- [Best Practices](#best-practices)
3535
- [Configuration](#configuration)
3636
- [Endpoints](#endpoints)
3737
- [Variables](#variables)
@@ -121,8 +121,9 @@ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer API_T
121121

122122
#### Placeholders
123123

124-
If you are not comfortable / don't want to hardcode your Number for example and/or Recipients in you, may use **Placeholders** in your Request. See [Custom Variables](#variables).
124+
If you are not comfortable / don't want to hardcode your Number for example and/or Recipients in you, may use **Placeholders** in your Request.
125125

126+
You can use [**Variable**](#variables) (`{{.NUMBER}}`) Placeholders and **Body** Placeholders (`{{@data.key}}`)
126127
These Placeholders can be used in the Request Query or the Body of a Request like so:
127128

128129
**Body**
@@ -146,6 +147,14 @@ http://sec-signal-api:8880/v1/receive/?@number={{.NUMBER}}
146147
http://sec-signal-api:8880/v1/receive/{{.NUMBER}}
147148
```
148149

150+
You can also combine them:
151+
152+
```json
153+
{
154+
"content": "{{.NUMBER}} -> {{.RECIPIENTS}}"
155+
}
156+
```
157+
149158
#### KeyValue Pair Injection
150159

151160
In some cases you may not be able to access / modify the Request Body, in that case specify needed values in the Request Query:
@@ -295,6 +304,21 @@ settings:
295304
recipients: ["+123400002", "group.id", "user.id"]
296305
```
297306

307+
### Message Templates
308+
309+
To customize the `message` attribute you can use **Message Templates** to build your message by using other Body Keys and Variables.
310+
Use `messageTemplate` to configure:
311+
312+
```yaml
313+
settings:
314+
messageTemplate: |
315+
Your Message:
316+
{{@message}}.
317+
Sent with Secured Signal API.
318+
```
319+
320+
Use `{{@data.key}}` to reference Body Keys and `{{.KEY}}` for Variables.
321+
298322
### Data Aliases
299323

300324
To improve compatibility with other services Secured Signal API provides **Data Aliases** and a built-in `message` Alias.
@@ -327,9 +351,9 @@ settings:
327351
{ alias: "data.message", score: 79 },
328352
{ alias: "array[0].message", score: 78 },
329353
]
330-
".NUMBER":
354+
".NUMBER":
331355
[
332-
{ alias: "phone_number", score: 100 },
356+
{ alias: "phone_number", score: 100 },
333357
]
334358
```
335359

0 commit comments

Comments
 (0)