In my usecase , I need to trigger an email to DL in case of error scenerios by calling a REST service irrespective of the main flow.
Implementation done in my proxy (Default fault Rule section).
1. Assign message to define my error template
2. A service callout to call the email trigger service.
3. Raise fault to throw error
Queries
- Best way to trigger email without affecting the actual flow ?
- Any options like fire and forget so that it will not affect the actual error flow?
- what if the email trigger service callout failed?
Eg : If my usecase returns 401 unauthorized
Scenerio 1 : If email trigger Service callout is 200 Success - 401 unauthorized will be returned to the user
Scenerio 2 : If email trigger Service callout is 4xx Failure - then 4xx Failure message will be returned to the user (which is not the expected result as error message to the user should be 401 unauthorized)
Help with the best approach !