-
Notifications
You must be signed in to change notification settings - Fork 414
Fix: Add sendEmail documentation for non-existent users for all affected versions (Product IS issue #27610) #6076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
|
|
||
| ##### onLoginRequest(context) | ||
|
Check failure on line 21 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md
|
||
|
|
||
| This function is called when the initial authentication request is | ||
| received by the framework. It includes the following parameters. | ||
|
|
@@ -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
|
||
|
|
||
| ``` 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
|
||
| ` eventCallbacks ` . Example: | ||
|
Check failure on line 71 in en/identity-server/5.10.0/docs/references/adaptive-authentication-js-api-reference.md
|
||
|
|
||
| ``` java | ||
| executeStep(1, { | ||
|
|
@@ -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
|
||
|
|
||
| **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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other versions contains |
||
| var email = 'user@example.com'; | ||
| var otp = '123456'; | ||
| var sent = sendEmail(context.currentKnownSubject, 'EmailOTP', { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| 'send-to': email, | ||
| 'flowType': 'registration', | ||
| 'OTPCode': otp | ||
| }); | ||
| ``` | ||
|
|
||
| ##### sendError(url,parameters) | ||
|
|
||
| This function redirects the user to an error page. It includes the | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standardize product naming in the new The phrase “identity server” should use the official product name/capitalization for consistency ( 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
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| 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 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be
Suggested change
|
||||||
| <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
|
||||||
| </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)` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
As per coding guidelines: "Use official product and feature names exactly as defined; do not invent shorthand names, change capitalization..."
📝 Committable suggestion
🤖 Prompt for AI Agents