Skip to content
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

Log an error on carbon logs when adding an email template with existing name #19300

Open
AnuradhaSK opened this issue Jan 31, 2024 · 2 comments · May be fixed by wso2/identity-api-server#772
Open

Comments

@AnuradhaSK
Copy link
Contributor

Describe the issue:
Try this API

curl --location 'https://localhost:9443/t/carbon.super/api/server/v1/email/template-types' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--data '{
  "displayName": "Account Confirmation",
  "templates": [
    {
      "contentType": "text/html",
      "subject": "WSO2 - Account Confirmation",
      "body": "HTML Body",
      "footer": "WSO2 Identity Server Team",
      "id": "en_US"
    }
  ]
}'

Since there is an email template with same name, the response is 409 status code with

{
    "code": "ETM-50005",
    "message": "Email Template Type already exists in the system.",
    "description": "An email template type for the provided template display name already exists in the system.",
    "traceId": "c0507a01-5766-4be3-9256-eafda3d95b7e"
}

This is a client exception, Therefore no need to log any error log in carbon logs.
but the following getting logged in carbon log

osgi> [2024-01-31 09:33:23,011] [9decd25a-3a29-4a7e-ae2d-5e316e7328e2] ERROR {org.wso2.carbon.identity.rest.api.server.email.template.v1.core.ServerEmailTemplatesService} - errorCode: ETM-50005 | message: Server encountered an error while adding the email template type.
@kumardeepak5
Copy link

Hi @AnuradhaSK ,
are you currently working on this issue? I’d like to contribute. Could you please confirm?

@kumardeepak5 kumardeepak5 linked a pull request Jan 9, 2025 that will close this issue
@kumardeepak5
Copy link

@AnuradhaSK , Please Review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Open
Development

Successfully merging a pull request may close this issue.

2 participants