Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
language similar to JavaScript, common knowledge on JavaScript may help
you to compose effective authentication scripts.

### Core functions

Check failure on line 19 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Heading levels should only increment by one level at a time

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:19 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md001.md

##### onLoginRequest(context)

Check failure on line 21 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Disallow consecutive headings

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:21 no-consecutive-headings Disallow consecutive headings [Consecutive headings are not allowed.] [Context: "##### onLoginRequest(context)"]

Check failure on line 21 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Heading levels should only increment by one level at a time

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:21 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h4; Actual: h5] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md001.md

This function is called when the initial authentication request is
received by the framework. It includes the following parameters.
Expand Down Expand Up @@ -61,14 +61,14 @@

The API can be called in either of the following ways:

- With only the ` stepId ` . Example:

Check failure on line 64 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces inside code span elements

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:64:37 MD038/no-space-in-code Spaces inside code span elements [Context: "` stepId `"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md038.md

Check failure on line 64 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces inside code span elements

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:64:20 MD038/no-space-in-code Spaces inside code span elements [Context: "` stepId `"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md038.md

Check failure on line 64 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces after list markers

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:64:1 MD030/list-marker-space Spaces after list markers [Expected: 1; Actual: 3] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md030.md

``` java
executeStep(1)
```

- With only the ` stepId ` and

Check failure on line 70 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces inside code span elements

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:70:37 MD038/no-space-in-code Spaces inside code span elements [Context: "` stepId `"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md038.md

Check failure on line 70 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces inside code span elements

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:70:20 MD038/no-space-in-code Spaces inside code span elements [Context: "` stepId `"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md038.md

Check failure on line 70 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces after list markers

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:70:1 MD030/list-marker-space Spaces after list markers [Expected: 1; Actual: 3] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md030.md
` eventCallbacks ` . Example:

Check failure on line 71 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / lint

Spaces inside code span elements

en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md:71:6 MD038/no-space-in-code Spaces inside code span elements [Context: "` eventCallbacks ..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md038.md

``` java
executeStep(1, {
Expand Down Expand Up @@ -215,16 +215,30 @@
|-----------------------|--------------------------------------------------------------------------------------------------------|
| user | An object representing the user details. |
| templateId | Identifier of the email template. The email template specifies the body of the email that is sent out. |
| placeholderParameters | Used to replace any placeholders in the template. |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

Check warning on line 218 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'placeholderParameters'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'placeholderParameters'?", "location": {"path": "en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md", "range": {"start": {"line": 218, "column": 3}}}, "severity": "WARNING"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use the official product name in the new parameter description.

Please replace “identity server” with the official product name (for example, WSO2 Identity Server) to keep naming consistent and searchable across docs.

Suggested edit
-| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
+| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in WSO2 Identity Server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

As per coding guidelines: "Use official product and feature names exactly as defined; do not invent shorthand names, change capitalization..."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in WSO2 Identity Server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md`
at line 218, Update the description for the parameter named
placeholderParameters to use the official product name: replace the phrase
"identity server" with "WSO2 Identity Server" in the sentence that explains
sending emails to users who do not exist in the identity server; ensure the rest
of the wording and formatting (including the `send-to` and `flowType` bullets)
remain unchanged.


**Example code**

Send an email to an existing user:

``` java
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` java
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other versions contains js as the language tag.

var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't consistent with the https://github.com/wso2/docs-is/pull/6076/changes#diff-87bc7b8cfc53f6d4221a4689da15ef851d28a9f0980ede421b780a41783ff50aR225.

Existing users are resolved using var user = context.steps[1].subject;. Is this done consciously?

'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

##### sendError(url,parameters)

This function redirects the user to an error page. It includes the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,30 @@
|-----------------------|--------------------------------------------------------------------------------------------------------|
| user | An object representing the user details. |
| templateId | Identifier of the email template. The email template specifies the body of the email that is sent out. |
| placeholderParameters | Used to replace any placeholders in the template. |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

Check warning on line 245 in en/identity-server/5.11.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'placeholderParameters'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'placeholderParameters'?", "location": {"path": "en/identity-server/5.11.0/docs/references/adaptive-authentication-js-api-reference.md", "range": {"start": {"line": 245, "column": 3}}}, "severity": "WARNING"}

**Example code**

Send an email to an existing user:

``` java
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` java
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

##### sendError(url,parameters)

This function redirects the user to an error page. It includes the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,30 @@
|-----------------------|--------------------------------------------------------------------------------------------------------|
| user | An object representing the user details. |
| templateId | Identifier of the email template. The email template specifies the body of the email that is sent out. |
| placeholderParameters | Used to replace any placeholders in the template. |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

Check warning on line 218 in en/identity-server/5.9.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'placeholderParameters'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'placeholderParameters'?", "location": {"path": "en/identity-server/5.9.0/docs/references/adaptive-authentication-js-api-reference.md", "range": {"start": {"line": 218, "column": 3}}}, "severity": "WARNING"}

**Example code**

Send an email to an existing user:

``` java
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` java
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

##### sendError(url,parameters)

This function redirects the user to an error page. It includes the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,28 @@
|-----------------------|--------------------------------------------------------------------------------------------------------|
| user | An object representing the user details. |
| templateId | Identifier of the email template. The email template specifies the body of the email that is sent out. |
| placeholderParameters | Used to replace any placeholders in the template. |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

Check warning on line 236 in en/identity-server/6.0.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'placeholderParameters'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'placeholderParameters'?", "location": {"path": "en/identity-server/6.0.0/docs/references/adaptive-authentication-js-api-reference.md", "range": {"start": {"line": 236, "column": 3}}}, "severity": "WARNING"}

Send an email to an existing user:

``` java
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` java
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

#### sendError(url,parameters)

This function redirects the user to an error page. It includes the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,28 @@
|-----------------------|--------------------------------------------------------------------------------------------------------|
| user | An object representing the user details. |
| templateId | Identifier of the email template. The email template specifies the body of the email that is sent out. |
| placeholderParameters | Used to replace any placeholders in the template. |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

Check warning on line 275 in en/identity-server/6.1.0/docs/references/adaptive-authentication-js-api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'placeholderParameters'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'placeholderParameters'?", "location": {"path": "en/identity-server/6.1.0/docs/references/adaptive-authentication-js-api-reference.md", "range": {"start": {"line": 275, "column": 3}}}, "severity": "WARNING"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Standardize product naming in the new placeholderParameters text.

The phrase “identity server” should use the official product name/capitalization for consistency (WSO2 Identity Server).

Suggested edit
-| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
+| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in WSO2 Identity Server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |

As per coding guidelines: "Use official product and feature names exactly as defined; do not invent shorthand names, change capitalization..."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
| placeholderParameters | Used to replace any placeholders in the template.<br/><br/>This parameter also supports the following optional fields:<br/><ul><li>`send-to`: Specifies the email address to send the email to. Use this to send emails to users who do not exist in WSO2 Identity Server.</li><li>`flowType`: Specifies the flow type. Set this to `registration` when sending emails to non-existent users.</li></ul> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@en/identity-server/6.1.0/docs/references/adaptive-authentication-js-api-reference.md`
at line 275, The documentation entry for placeholderParameters uses the
lowercase phrase "identity server"; update the text associated with
placeholderParameters to use the official product name "WSO2 Identity Server"
(e.g., change "identity server" to "WSO2 Identity Server" in the sentence
describing sending emails to users who do not exist in the identity server) so
the parameter description follows product-naming guidelines.


Send an email to an existing user:

``` java
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` java
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

#### sendError(url,parameters)

This function redirects the user to an error page. It includes the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,19 +688,39 @@
</tr>
<tr>
<td><code>placeholderParameters</code></td>
<td>Used to replace any placeholders in the template.</td>
<td><p>Used to replace any placeholders in the template.</p>
<p>This parameter also supports the following optional fields:</p>
<ul>
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li>
<li><code>flowType</code>: Specifies the flow type. Set this to <code>registration</code> when sending emails to non-existent users.</li>

Check warning on line 695 in en/identity-server/7.0.0/docs/references/conditional-auth/api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'flowType'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'flowType'?", "location": {"path": "en/identity-server/7.0.0/docs/references/conditional-auth/api-reference.md", "range": {"start": {"line": 695, "column": 25}}}, "severity": "WARNING"}
</ul>
</td>
</tr>
</tbody>
</table>

- **Example**

Send an email to an existing user:

``` js
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` js
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

### Get parameter value from JWT

`getValueFromDecodedAssertion(jwt, parameterName, isParameterInPayload)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,19 +690,39 @@
</tr>
<tr>
<td><code>placeholderParameters</code></td>
<td>Used to replace any placeholders in the template.</td>
<td><p>Used to replace any placeholders in the template.</p>
<p>This parameter also supports the following optional fields:</p>
<ul>
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li>
<li><code>flowType</code>: Specifies the flow type. Set this to <code>registration</code> when sending emails to non-existent users.</li>

Check warning on line 697 in en/identity-server/7.1.0/docs/references/conditional-auth/api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'flowType'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'flowType'?", "location": {"path": "en/identity-server/7.1.0/docs/references/conditional-auth/api-reference.md", "range": {"start": {"line": 697, "column": 25}}}, "severity": "WARNING"}
</ul>
</td>
</tr>
</tbody>
</table>

- **Example**

Send an email to an existing user:

``` js
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` js
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

### Get parameter value from JWT

`getValueFromDecodedAssertion(jwt, parameterName, isParameterInPayload)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,39 @@
</tr>
<tr>
<td><code>placeholderParameters</code></td>
<td>Used to replace any placeholders in the template.</td>
<td><p>Used to replace any placeholders in the template.</p>
<p>This parameter also supports the following optional fields:</p>
<ul>
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li>
<li><code>flowType</code>: Specifies the flow type. Set this to <code>registration</code> when sending emails to non-existent users.</li>

Check warning on line 701 in en/identity-server/7.2.0/docs/references/conditional-auth/api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'flowType'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'flowType'?", "location": {"path": "en/identity-server/7.2.0/docs/references/conditional-auth/api-reference.md", "range": {"start": {"line": 701, "column": 25}}}, "severity": "WARNING"}
</ul>
</td>
</tr>
</tbody>
</table>

- **Example**

Send an email to an existing user:

``` js
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` js
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

### Get parameter value from JWT

`getValueFromDecodedAssertion(jwt, parameterName, isParameterInPayload)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,39 @@
</tr>
<tr>
<td><code>placeholderParameters</code></td>
<td>Used to replace any placeholders in the template.</td>
<td><p>Used to replace any placeholders in the template.</p>
<p>This parameter also supports the following optional fields:</p>
<ul>
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the identity server.</li>
<li><code>send-to</code>: Specifies the email address to send the email to. Use this to send emails to users who do not exist in the Identity Server.</li>

<li><code>flowType</code>: Specifies the flow type. Set this to <code>registration</code> when sending emails to non-existent users.</li>

Check warning on line 701 in en/identity-server/next/docs/references/conditional-auth/api-reference.md

View workflow job for this annotation

GitHub Actions / Vale style check

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'flowType'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'flowType'?", "location": {"path": "en/identity-server/next/docs/references/conditional-auth/api-reference.md", "range": {"start": {"line": 701, "column": 25}}}, "severity": "WARNING"}
</ul>
</td>
</tr>
</tbody>
</table>

- **Example**

Send an email to an existing user:

``` js
var user = context.steps[1].subject;
var firstName = user.localClaims['http://wso2.org/claims/givenname'];
sendEmail(user, 'myTemplate', {'firstName':firstName});
```

Send an email to a non-existent user:

``` js
var email = 'user@example.com';
var otp = '123456';
var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', {
'send-to': email,
'flowType': 'registration',
'OTPCode': otp
});
```

### Get parameter value from JWT

`getValueFromDecodedAssertion(jwt, parameterName, isParameterInPayload)`
Expand Down
Loading