WSO2 IS Recovery password / Home

46 Views Asked by At

Example: the mail is always sent to "email", but I want it also to be sent to: "Emails - Work Email" or "Emails - Home Email" or one that is manually included, I am consuming the API rest this way, using the "properties":

curl --location 'https://localhost:9443/api/identity/recovery/v0.9/recover-password?type=email&notify=true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data-raw '{
    "user": {
        "username": "imorales",
        "realm": "PRIMARY",
        "tenant-domain": "carbon.super"
    },
     "properties": [
        {
            "key": "callback",
            "value": "https://localhost:8084"
        },
        {
            "key": "additionalEmail",
            "value": "[email protected]"
        }
    ]
}'
 

could you help me with an idea to solve this requirement, using the api rest of is 6.1.0, however I have not been able to send it to another email.

1

There are 1 best solutions below

0
Sachin Mamoru On BEST ANSWER

You can write a custom event handler that listens to email sending events and modifies the recipient list to include additional email addresses based on your logic.

Implement a custom event handler by extending org.wso2.carbon.identity.event.handler.AbstractEventHandler. In your implementation, intercept the email sending event and modify the list of recipients to include the additional email addresses. Deploy your custom event handler as an OSGi bundle in WSO2 IS.

https://is.docs.wso2.com/en/latest/references/extend/user-mgt/write-a-custom-event-handler/#write-a-custom-event-handler