EmailClient

class oci.email.EmailClient(config, **kwargs)

API for the Email Delivery service. Use this API to send high-volume, application-generated emails. For more information, see [Overview of the Email Delivery Service](/iaas/Content/Email/Concepts/overview.htm).

Note: Write actions (POST, UPDATE, DELETE) may take several minutes to propagate and be reflected by the API. If a subsequent read request fails to reflect your changes, wait a few minutes and try again.

__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) -- Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) -- (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) -- (optional) The connection and read timeouts for the client. The default is that the client never times out. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) --

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) --

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

change_sender_compartment(sender_id, change_sender_compartment_details, **kwargs)

Moves a sender into a different compartment. Moves a sender into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:
  • sender_id (str) -- (required) The unique OCID of the sender.
  • change_sender_compartment_details (ChangeSenderCompartmentDetails) -- (required) Details for moving a sender into a different compartment.
  • if_match (str) -- (optional) Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

create_sender(create_sender_details, **kwargs)

Creates a sender for a tenancy in a given compartment. Creates a sender for a tenancy in a given compartment.

Parameters:
  • create_sender_details (CreateSenderDetails) -- (required) Create a sender.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Sender

Return type:

Response

create_suppression(create_suppression_details, **kwargs)

Creates an email suppression for a tenancy. Adds recipient email addresses to the suppression list for a tenancy. Addresses added to the suppression list via the API are denoted as "MANUAL" in the reason field. Note: All email addresses added to the suppression list are normalized to include only lowercase letters.

Parameters:
  • create_suppression_details (CreateSuppressionDetails) -- (required) Adds a single email address to the suppression list for a compartment's tenancy.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Suppression

Return type:

Response

delete_sender(sender_id, **kwargs)

Deletes a sender for a tenancy in a given compartment. Deletes an approved sender for a tenancy in a given compartment for a provided senderId.

Parameters:
  • sender_id (str) -- (required) The unique OCID of the sender.
  • if_match (str) -- (optional) Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

delete_suppression(suppression_id, **kwargs)

Deletes a suppressed email address. Removes a suppressed recipient email address from the suppression list for a tenancy in a given compartment for a provided suppressionId.

Parameters:
  • suppression_id (str) -- (required) The unique OCID of the suppression.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type None

Return type:

Response

get_sender(sender_id, **kwargs)

Gets an approved sender. Gets an approved sender for a given senderId.

Parameters:
  • sender_id (str) -- (required) The unique OCID of the sender.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Sender

Return type:

Response

get_suppression(suppression_id, **kwargs)

Get a suppressed email address. Gets the details of a suppressed recipient email address for a given suppressionId. Each suppression is given a unique OCID.

Parameters:
  • suppression_id (str) -- (required) The unique OCID of the suppression.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Suppression

Return type:

Response

list_senders(compartment_id, **kwargs)

Get a list of approved sender summaries. Gets a collection of approved sender email addresses and sender IDs.

Parameters:
  • compartment_id (str) -- (required) The OCID for the compartment.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • lifecycle_state (str) --

    (optional) The current state of a sender.

    Allowed values are: "CREATING", "ACTIVE", "DELETING", "DELETED"

  • email_address (str) -- (optional) The email address of the approved sender.
  • page (str) --

    (optional) For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • limit (int) --

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • sort_by (str) --

    (optional) The field to sort by. The TIMECREATED value returns the list in in descending order by default. The EMAILADDRESS value returns the list in ascending order by default. Use the SortOrderQueryParam to change the direction of the returned list of items.

    Allowed values are: "TIMECREATED", "EMAILADDRESS"

  • sort_order (str) --

    (optional) The sort order to use, either ascending or descending order.

    Allowed values are: "ASC", "DESC"

  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of SenderSummary

Return type:

Response

list_suppressions(compartment_id, **kwargs)

Get a summary of suppressed email addresses. Gets a list of suppressed recipient email addresses for a user. The compartmentId for suppressions must be a tenancy OCID. The returned list is sorted by creation time in descending order.

Parameters:
  • compartment_id (str) -- (required) The OCID for the compartment.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • email_address (str) -- (optional) The email address of the suppression.
  • time_created_greater_than_or_equal_to (datetime) --

    (optional) Search for suppressions that were created within a specific date range, using this parameter to specify the earliest creation date for the returned list (inclusive). Specifying this parameter without the corresponding timeCreatedLessThan parameter will retrieve suppressions created from the given timeCreatedGreaterThanOrEqualTo to the current time, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

    Example: 2016-12-19T16:39:57.600Z

  • time_created_less_than (datetime) --

    (optional) Search for suppressions that were created within a specific date range, using this parameter to specify the latest creation date for the returned list (exclusive). Specifying this parameter without the corresponding timeCreatedGreaterThanOrEqualTo parameter will retrieve all suppressions created before the specified end date, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

    Example: 2016-12-19T16:39:57.600Z

  • page (str) --

    (optional) For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • limit (int) --

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • sort_by (str) --

    (optional) The field to sort by. The TIMECREATED value returns the list in in descending order by default. The EMAILADDRESS value returns the list in ascending order by default. Use the SortOrderQueryParam to change the direction of the returned list of items.

    Allowed values are: "TIMECREATED", "EMAILADDRESS"

  • sort_order (str) --

    (optional) The sort order to use, either ascending or descending order.

    Allowed values are: "ASC", "DESC"

  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type list of SuppressionSummary

Return type:

Response

update_sender(sender_id, update_sender_details, **kwargs)

Updates the tags for a given sender. Replaces the set of tags for a sender with the tags provided. If either freeform or defined tags are omitted, the tags for that set remain the same. Each set must include the full set of tags for the sender, partial updates are not permitted. For more information about tagging, see Resource Tags.

Parameters:
  • sender_id (str) -- (required) The unique OCID of the sender.
  • update_sender_details (UpdateSenderDetails) -- (required) update details for sender.
  • if_match (str) -- (optional) Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
  • opc_request_id (str) -- (optional) The request ID for tracing from the system
  • retry_strategy (obj) --

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

Returns:

A Response object with data of type Sender

Return type:

Response