Email Actions (Office 365)
Email actions using the Office 365 API.
To read or send emails, you must have the Tenant ID, Client ID, Client Secret and User ID credentials. To follow a step-by-step guide to creating the app: Azure App Creation Tutorial
Actions
office365.create_office365_client
Create a new connection to the Office 365 API.
Parameters:
tenant_id - Tenant ID data for the app created in Azure.
client_id - Client ID data for the user in Azure.
client_secret - Secret data for the app created in Azure.
user_id - Azure user ID information.
pagination_limit (optional) - Pagination size (number of emails per search). The default value is 50.
folder_name (optional) - Name of the folder in which the emails will be searched. By default it is done in the 'Inbox'.
Returns:
email_client - email_client to be used in other email actions.
emails_count - returns the total number of emails in default_folder
.
current_folder - current folder name.
Exceptions:
This action provides no exceptions.
office365.delete
Deletes the current message.
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
Returns:
This action gives no return.
Exceptions:
This action provides no exceptions.
office365.find_attachments
Allows you to return all attachments from the current email or search for a specific attachment by name
.
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
attach_name (optional) - name or partial name of the attachment to search for (default=filter by name)
Returns:
attachments - list of all attachments that satisfy the search.
attachments_count - number of attachments that satisfy the search.
Exceptions:
This action provides no exceptions.
office365.get_current_email
Returns the email message at the current position in the Office 365 email client.
Parameters:
email_client - client connection to the Mail Server. Connections are created using office365.create_office365_client
Returns:
id - email id in the Office 365 API.
from - name of the user who sent the email message.
from_address - returns only the email address of the message sender.
subject - subject of the email message.
date - data and time the message was sent.
html_body - email message content as HTML content.
has_attachments - Boolean variable setting whether the email message has attachments or not.
check_read - Boolean variable setting whether the email message was read or not.
Exceptions:
This action provides no exceptions.
office365.list_folders
Returns a list of all folders available in the connected email account.
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
Returns:
folders - list with the name of all folders in the connected email account.
Exceptions:
This action provides no exceptions.
office365.move_to
Move the current email to another existing email account folder.
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
to_folder - name of the folder where the current message should be moved.
Returns:
This action has no return.
Exceptions:
This action provides no exceptions.
office365.next_email
Move current position to next email (next most recent message).
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
Returns:
id - email id in the Office 365 API.
from - name of the user who sent the email message.
from_address - returns only the email address of the message sender.
subject - subject of the email message.
date - data and time the message was sent.
html_body - email message content as HTML content.
has_attachments - Boolean variable setting whether the email message has attachments or not.
check_read - Boolean variable setting whether the email message was read or not.
Exceptions:
This action provides no exceptions.
office365.previous_email
Move current position to previous email (next oldest message).
Parameters:
email_client - client connection to the Office 365 API. Connections are created using office365.create_office365_client
Returns:
id - email id in the Office 365 API.
from - username I send