Set email service data
/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
- application/json
object- 
            emailNotificationTypes(optional): 
            array  emailNotificationTypes
            
            Email Notification Types
- 
            emailServiceProperties(optional): 
            object  emailServiceProperties
            
            Email Service Properties
{
    "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"
        }
    ]
}object- 
            emailServiceType: 
            string
            Must be DEFAULT or SMTP.
- 
            emailSMTPAuthMethod(optional): 
            string
            The SMTP Authorisation method - either SSL or TLS.
- 
            emailSMTPHost(optional): 
            string
            The SMTP host.
- 
            emailSMTPPassword(optional): 
            string
            User password for the SMTP server.
- 
            emailSMTPPort(optional): 
            string
            Port to use to communicate with the SMTP host. Needs to be 465 or 587 as appropriate for the value set in emailSMTPAuthMethod.
- 
            emailSMTPUsername(optional): 
            string
            User login for the SMTP server.
object- 
            displayName(optional): 
            string
            email notification display name
- 
            enabled(optional): 
            boolean
            true - this notification is enabled and an email will be sent out, false - disable no email sent when triggered
- 
            fromEmail(optional): 
            string
            from email address
- 
            fromName(optional): 
            string
            from name
- 
            id(optional): 
            string
            key
- 
            includeRecommendations(optional): 
            boolean
            true - product recommendations will be included in the email, false - product recommendations will not be included in the email
- 
            numberOfRecommendations(optional): 
            integer
            Number of product recommendations to include in email
- 
            recommendationsRestriction(optional): 
            string
            The recommendations restriction
- 
            recommendationsStrategy(optional): 
            string
            The recommendations strategy
Response
- application/json
200 Response
object- 
            emailNotificationTypes(optional): 
            array  emailNotificationTypes
            
            Email notification types
- 
            emailServiceProperties(optional): 
            object  emailServiceProperties
            
            Email service properties
object- 
            emailServiceType: 
            string
            Must be DEFAULT or SMTP.
- 
            emailSMTPAuthMethod(optional): 
            string
            The SMTP Authorisation method - either SSL or TLS.
- 
            emailSMTPHost(optional): 
            string
            The SMTP host.
- 
            emailSMTPPassword(optional): 
            string
            User password for the SMTP server.
- 
            emailSMTPPort(optional): 
            string
            Port to use to communicate with the SMTP host.
- 
            emailSMTPUsername(optional): 
            string
            User login for the SMTP server.
object- 
            description(optional): 
            string
            email notification description - usually null
- 
            displayName(optional): 
            string
            email notification display name
- 
            enabled(optional): 
            boolean
            true - this notification is enabled and an email will be sent out, false - disable no email sent when triggered
- 
            fromEmail(optional): 
            string
            from email address
- 
            fromName(optional): 
            string
            from name
- 
            id(optional): 
            string
            key
- 
            includeRecommendations(optional): 
            boolean
            true - product recommendations will be included in the email, false - product recommendations will not be included in the email
- 
            numberOfRecommendations(optional): 
            integer
            Number of product recommendations to include in email
- 
            recommendationsAllowAnyStrategy(optional): 
            boolean
            true - any recommendations strategy (e.g. Blended, Top Sellers, Bought Together, Browsed Together) can be used, false - only specific recommendation strategies are permitted
- 
            recommendationsAllowRestrictions(optional): 
            boolean
            true - allow restrictions (such as 'in-brand' or 'in-category' to be applied to the recommendation strategy, false - don't allow restrictions to be applied to the recommendation strategy
- 
            recommendationsPermittedStrategies(optional): 
            array  recommendationsPermittedStrategies
            
            Array of recommendation strategy keys permitted for this notification type
- 
            recommendationsRestriction(optional): 
            string
            The recommendations restriction
- 
            recommendationsStrategy(optional): 
            string
            The recommendations strategy
- 
            recommendationsSupported(optional): 
            boolean
            true - product recommendations are supported, false - product recommendations are not supported
- 
            version(optional): 
            integer
            email notification version - usually 1
array{
    "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
| Error Code | Description | Possible Fix | 
|---|---|---|
| 950002 | Unable to set email service data. | See returned error messages for further information. | 
| 950046 | Error Updating the Email Notification Type. | See returned error messages for further information. | 
| 93011 | A problem occurred when saving the data | See returned error messages for further information. | 
| 950004 | 'emailServiceType' property value is blank | Correct your input data. | 
| 95022 | 'emailServiceType' property value is invalid | Correct your input data. | 
| 950005 | 'emailSmtpUsername' is blank | Correct your input data. | 
| 950006 | Username given in 'emailSmtpUsername' is too long | Correct your input data. | 
| 950007 | 'emailSMTPPassword' property value is blank | Correct your input data. | 
| 950008 | 'emailSMTPHost' property value is blank | Correct your input data. | 
| 950023 | 'emailSMTPAuthMethod' property value is blank | Correct your input data. | 
| 950009 | 'emailSMTPHost' property value is blank | Correct your input data. | 
| 950010 | 'emailSMTPHost' property value is too long | Correct your input data. | 
| 950011 | 'emailSMTPPort' property value is blank | Correct your input data. | 
| 950012 | 'emailSMTPPort' property value is too long | Correct your input data. | 
| 950013 | 'emailSMTPPort' property value is non-numeric | Correct your input data. | 
| 950014 | 'emailSMTPPort' proprrty value is too large | Correct your input data. | 
| 950015 | 'emailSMTPPort' property value is not 465 for 'emailSMTPAuthMethod' of 'SSL' | Correct your input data. | 
The error response:
object- 
            devMessage(optional): 
            string
            An optional non-localized message containing technical information for developers
- 
            errorCode(optional): 
            string
            The numerical code identifying the error
- 
            errors(optional): 
            array  errors
            
            An optional list of errors if multiple errors were encountered
- 
            message(optional): 
            string
            The localized message describing the error
- 
            moreInfo(optional): 
            string
            An optional non-localized message with more information
- 
            o:errorPath(optional): 
            string
            An optional machine readable description of where the error occurred
- 
            status(optional): 
            string
            The HTTP status code
- 
            type(optional): 
            string
            The URI to the HTTP state code definition
arrayobject- 
            devMessage(optional): 
            string
            An optional non-localized message containing technical information for developers
- 
            errorCode(optional): 
            string
            The numerical code identifying the error
- 
            message(optional): 
            string
            The localized message describing the error
- 
            moreInfo(optional): 
            string
            An optional non-localized message with more information
- 
            o:errorPath(optional): 
            string
            An optional machine readable description of where the error occurred
- 
            status(optional): 
            string
            The HTTP status code