OpenXchangeClient.Api.MailCompose (open_xchange_client v0.10.1)

API calls for all endpoints tagged MailCompose.

Link to this section Summary

Functions

Deletes the composition space under the given identifier

Get binary attachment. This URL pattern can be used for inline images.

Get all open spaces Returns a JSON array of compositions spaces

Load the composition space under the given identifier

Save as draft. Space gets deleted.

Updates the composition space Payload is JSON that reflects changes. Response is the current composition space message model after update.

Uploads an attachment again and removes the old attachment from the server. Used for image resize.

Add all original attachments (useful for replies).

Create a new composition space For any types but "new", the response provides ready-to-use values, e.g. to, cc, bcc, subject with prefix, attachments. Internally all mime headers are set properly (a..g to maintain threads). Only the content is still original, i.e. the client uses DOMPurify to sanitize and to quote the content.

Send message. Space gets deleted. Optionally deletes draft if referenced.

Link to this section Functions

Link to this function

delete_attachments_by_id(connection, session, id, attachment_id, opts \\ [])

@spec delete_attachments_by_id(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.InlineResponse2002.t()}
  | {:error, Tesla.Env.t()}

Delete an existing attachment.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • attachment_id (String.t): The ID of the attachment
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

delete_mail_compose_by_id(connection, session, id, opts \\ [])

@spec delete_mail_compose_by_id(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.InlineResponse2001.t()}
  | {:error, Tesla.Env.t()}

Deletes the composition space under the given identifier

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_attachments_by_id(connection, session, id, attachment_id, opts \\ [])

@spec get_attachments_by_id(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil} | {:ok, String.t()} | {:error, Tesla.Env.t()}

Get binary attachment. This URL pattern can be used for inline images.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • attachment_id (String.t): The ID of the attachment
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_mail_compose(connection, session, opts \\ [])

@spec get_mail_compose(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeGetResponse.t()}
  | {:error, Tesla.Env.t()}

Get all open spaces Returns a JSON array of compositions spaces

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • opts (KeywordList): [optional] Optional parameters
    • :columns (String.t): A comma-separated list of columns to return. Each column is specified by the name of the Composition Space attribute. If no columns are specified only the "id" column is set.

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_mail_compose_by_id(connection, session, id, opts \\ [])

@spec get_mail_compose_by_id(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeResponse.t()}
  | {:error, Tesla.Env.t()}

Load the composition space under the given identifier

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_save(connection, session, id, opts \\ [])

@spec get_save(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeSendResponse.t()}
  | {:error, Tesla.Env.t()}

Save as draft. Space gets deleted.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

patch_mail_compose_by_id(connection, session, id, body, opts \\ [])

Updates the composition space Payload is JSON that reflects changes. Response is the current composition space message model after update.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • body (MailComposeMessageModel): An object containing the attributes to update
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_attachments(connection, session, id, file, opts \\ [])

@spec post_attachments(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeAttachmentResponse.t()}
  | {:error, Tesla.Env.t()}

Add new attachment.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • file (String.t): The file to add
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_attachments_by_id(connection, session, id, attachment_id, file, opts \\ [])

@spec post_attachments_by_id(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeAttachmentResponse.t()}
  | {:error, Tesla.Env.t()}

Uploads an attachment again and removes the old attachment from the server. Used for image resize.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • attachment_id (String.t): The ID of the attachment
  • file (String.t): The file to add
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_attachments_original(connection, session, id, opts \\ [])

@spec post_attachments_original(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, OpenXchangeClient.Model.MailComposeAttachmentPostResponse.t()}
  | {:ok, nil}
  | {:error, Tesla.Env.t()}

Add all original attachments (useful for replies).

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_attachments_vcard(connection, session, id, opts \\ [])

@spec post_attachments_vcard(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeAttachmentResponse.t()}
  | {:error, Tesla.Env.t()}

Attach vcard later on.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_mail_compose(connection, session, opts \\ [])

@spec post_mail_compose(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeResponse.t()}
  | {:error, Tesla.Env.t()}

Create a new composition space For any types but "new", the response provides ready-to-use values, e.g. to, cc, bcc, subject with prefix, attachments. Internally all mime headers are set properly (a..g to maintain threads). Only the content is still original, i.e. the client uses DOMPurify to sanitize and to quote the content.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • opts (KeywordList): [optional] Optional parameters
    • :type (String.t): One of new/reply/replyall/forward/resend/edit/copy
    • :vcard (boolean()): Attach users vcard
    • :body ([OpenXchangeClient.Model.InlineObject.t]): Array of Objects (id, folderId) to reference mails (reply or multiple on forward as example)

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

post_mail_compose_send(connection, session, id, j_son, opts \\ [])

@spec post_mail_compose_send(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, OpenXchangeClient.Model.MailComposeSendResponse.t()}
  | {:error, Tesla.Env.t()}

Send message. Space gets deleted. Optionally deletes draft if referenced.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the composition space
  • j_son (String.t): Represents the request body as JSON string containing the MailMessageModel.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure