Set email service data

post

/ccadmin/v1/email

Sets the email service settings and site-specific email type settings.

Changing the standard email service settings is not advisable, but it is a legacy feature of the endpoint. The primary purpose of the endpoint is to allow configuration of email types for a given site.

This endpoint relies on the site context being specified via the X-CCSite request header or the occsite query parameter. If the site is omitted, the settings will be applied to the default site.

If the request is successful, the response body will be a JSON object containing two JSON objects: an 'emailNotificationTypes' object containing the available email types and their site-specific settings, and an 'emailServiceProperties' endpoint containing the email service settings.

Request

Supported Media Types
Body ()
Root Schema : setEmailServiceData_request
Type: object
Show Source
Example:
{
    "emailServiceProperties":{
        "emailSMTPPort":"587",
        "emailSMTPHost":"smtp.example.com",
        "emailServiceType":"SMTP",
        "emailSMTPAuthMethod":"TLS",
        "emailSMTPPassword":"example",
        "emailSMTPUsername":"example@example.com"
    },
    "emailNotificationTypes":[
        {
            "displayName":"Forgot Password Email",
            "recommendationsRestriction":null,
            "fromName":"Forgot Password",
            "includeRecommendations":false,
            "id":"forgot_password_v1",
            "numberOfRecommendations":3,
            "recommendationsStrategy":null,
            "enabled":true,
            "fromEmail":"info@example.com"
        },
        {
            "displayName":"Abandon Order",
            "recommendationsRestriction":"unrestricted",
            "fromName":"Abandon Order xx",
            "includeRecommendations":true,
            "id":"abandon_order_v1",
            "numberOfRecommendations":3,
            "recommendationsStrategy":"blended",
            "enabled":true,
            "fromEmail":"info@example.com"
        }
    ]
}
Nested Schema : emailNotificationTypes
Type: array
Email Notification Types
Show Source
Nested Schema : emailServiceProperties
Type: object
Email Service Properties
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Returned when the operation succeeds.
Body ()
Root Schema : setEmailServiceData_200_response
Type: object
Show Source
Nested Schema : emailNotificationTypes
Type: array
Email notification types
Show Source
Nested Schema : emailServiceProperties
Type: object
Email service properties
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : recommendationsPermittedStrategies
Type: array
Array of recommendation strategy keys permitted for this notification type
Show Source
Example Response (application/json)
{
    "emailServiceProperties":{
        "emailServiceType":"DEFAULT"
    },
    "links":[
        {
            "rel":"self",
            "href":"/email"
        }
    ],
    "emailNotificationTypes":{
        "ccadmin_user_password_reset_v1":{
            "recommendationsSupported":false,
            "displayName":"Oracle Commerce Cloud Admin Password Reset",
            "description":null,
            "recommendationsStrategy":null,
            "version":1,
            "enabled":false,
            "fromEmail":null,
            "recommendationsAllowAnyStrategy":true,
            "recommendationsRestriction":null,
            "fromName":null,
            "recommendationsAllowRestrictions":true,
            "includeRecommendations":false,
            "id":"ccadmin_user_password_reset_v1",
            "recommendationsPermittedStrategies":[
            ],
            "numberOfRecommendations":12
        },
        "placed_order_v1":{
            "recommendationsSupported":false,
            "displayName":"Order Placed",
            "description":null,
            "recommendationsStrategy":null,
            "version":1,
            "enabled":false,
            "fromEmail":null,
            "recommendationsAllowAnyStrategy":true,
            "recommendationsRestriction":null,
            "fromName":null,
            "recommendationsAllowRestrictions":true,
            "includeRecommendations":false,
            "id":"placed_order_v1",
            "recommendationsPermittedStrategies":[
            ],
            "numberOfRecommendations":12
        }
    }
}

Default Response

The following internal error codes are thrown by this API when the request fails in Commerce:
Error CodeDescriptionPossible Fix
950002Unable to set email service data.See returned error messages for further information.
950046Error Updating the Email Notification Type.See returned error messages for further information.
93011A problem occurred when saving the dataSee returned error messages for further information.
950004'emailServiceType' property value is blankCorrect your input data.
95022'emailServiceType' property value is invalidCorrect your input data.
950005'emailSmtpUsername' is blankCorrect your input data.
950006Username given in 'emailSmtpUsername' is too longCorrect your input data.
950007'emailSMTPPassword' property value is blankCorrect your input data.
950008'emailSMTPHost' property value is blankCorrect your input data.
950023'emailSMTPAuthMethod' property value is blankCorrect your input data.
950009'emailSMTPHost' property value is blankCorrect your input data.
950010'emailSMTPHost' property value is too longCorrect your input data.
950011'emailSMTPPort' property value is blankCorrect your input data.
950012'emailSMTPPort' property value is too longCorrect your input data.
950013'emailSMTPPort' property value is non-numericCorrect your input data.
950014'emailSMTPPort' proprrty value is too largeCorrect your input data.
950015'emailSMTPPort' property value is not 465 for 'emailSMTPAuthMethod' of 'SSL'Correct your input data.

The error response:
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top