Messaging channels#

class dataikuapi.dss.messaging_channel.DSSMessagingChannelListItem(client, data)#

A generic messaging channel in DSS.

Important

Do not instantiate this class, use dataikuapi.DSSClient.list_messaging_channels()

property id#

ID of the messaging channel

Type:

str

property type#

Type of the messaging channel

Type:

str

property family#

Family of the messaging channel where relevant - e.g. “mail”

Type:

str

get_raw()#
Returns:

Gets the raw representation of this DSSMessagingChannelListItem, any edit is reflected in the object.

Return type:

dict

get_as_messaging_channel()#
Returns:

The same messaging channel but as the appropriate object type

Return type:

DSSMessagingChannel

class dataikuapi.dss.messaging_channel.DSSMailMessagingChannel(client, data)#

A handle to interact with an email messaging channel on the DSS instance - a subclass of DSSMessagingChannel

Important

Do not instantiate this class directly, use dataikuapi.DSSClient.get_messaging_channel()

property sender#

Sender for the messaging channel, if present

Return type:

str

send(project_key, to, subject, body, attachments=None, plain_text=False, sender=None, cc=None, bcc=None)#

Send an email with or without attachments to a list of recipients

channel = client.get_messaging_channel("mail-channel-id")
channel.send("PROJECT_KEY", ["john.doe@dataiku.com", "jane.doe@dataiku.com"], "Hello there!", "<html><body>Some HTML body</body></html>")

channel = client.get_messaging_channel("other-mail-channel-id")
for file in paths:
with open(file) as f:
    # Optionally include file type ("text/csv")
    attachments.append(file, f.read(), "text/csv")
channel.send("PROJECT_KEY", ["joe@dataiku.com"], "Subject", "Body in plain text",  attachments=attachments, False)
Parameters:
  • project_key (str) – project issuing the email. The user must have “Write content” permission on the specified project.

  • to (list[str]) – email addresses of recipients

  • subject (str) – email subject

  • body (str) – email body (in plain text or HTML format)

  • attachments (list[BufferedReader]) – files to be attached to the mail, defaults to None

  • plain_text (bool) – True to send email as plain text, False to send it as HTML. Defaults to False.

  • sender (str) – sender email address. Use None to use the sender defined at the channel level.

  • cc (list[str]) – email addresses of recipients in carbon copy

  • bcc (list[str]) – email addresses of recipients in blind carbon copy

class dataikuapi.dss.messaging_channel.DSSMessagingChannel(client, data=None)#

A handle to interact with a messaging channel on the DSS instance. A generic DSS messaging channel

Important

Do not instantiate this class directly, use dataikuapi.DSSClient.get_messaging_channel()

property id#

ID of the messaging channel

Return type:

str

property type#

Type of the messaging channel

Return type:

str

property family#

Family of the messaging channel where relevant - e.g. “mail”

Type:

str