Updates the server's email alert settings. Every field is optional; an omitted field is not changed. A setting that has no stored value yet is created.
Omit password to keep the stored password. An empty password, or one made only of * characters, also keeps it. Changing host or username from the stored value needs a new password in the same request, so a stored password is never sent to a different server or account.
Sending any of host, from_address, username or password sets a custom SMTP server. After the merge with the stored values, all four must be non-empty, so the first custom SMTP save needs all four.
Authorization
Same as GET /email_settings: internal API clients only; COMPANY or SERVER users on a ZWS-integrated server, SERVER users only otherwise.
Responses
-
OK - the settings were saved. The body is the updated settings, in the same shape as
GET. -
Bad Request - the body is not a JSON object, a field has the wrong type,
subject,host,from_addressorusernameis empty or spans more than one line,hostis not a host name or IP address,from_addressis not a valid email address, or the SMTP credentials would be left incomplete. -
Unauthorized - missing or invalid bearer token.
-
Forbidden - the client is not internal, or the user's role is not allowed (see Authorization).
curl \
--request PUT 'https://api.iformbuilder.com/exzact/api/v80/[servername]/email_settings' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {access_token}" \
--data '{
"host": "smtp.example.com",
"from_address": "alerts@example.com",
"username": "mailer",
"password": "{smtp_password}",
"subject": "Record received"
}'
{
"host": "smtp.example.com",
"from_address": "alerts@example.com",
"username": "mailer",
"password": "{smtp_password}",
"subject": "Record received"
}
{
"custom": true,
"host": "smtp.example.com",
"from_address": "alerts@example.com",
"username": "mailer",
"password_set": true,
"subject": "Record received",
"footer": "",
"footer2": ""
}