Glific v0.3.1 Glific.Communications.Message View Source

The Message Communication Context, which encapsulates and manages tags and the related join tables.

Link to this section Summary

Functions

Callback in case of any error while sending the message

Callback when message send succsully

Callback when we receive a message from whats app

Send message to receiver using define provider.

Callback to update the provider status for a message

Link to this section Functions

Link to this function

handle_error_response(response, message)

View Source

Specs

handle_error_response(Tesla.Env.t(), Glific.Messages.Message.t()) ::
  {:error, String.t()}

Callback in case of any error while sending the message

Link to this function

handle_success_response(response, message)

View Source

Specs

handle_success_response(Tesla.Env.t(), Glific.Messages.Message.t()) ::
  {:ok, Glific.Messages.Message.t()}

Callback when message send succsully

Link to this function

receive_message(message_params, type \\ :text)

View Source

Specs

receive_message(map(), atom()) :: {:ok} | {:error, String.t()}

Callback when we receive a message from whats app

Specs

send_message(Glific.Messages.Message.t()) ::
  {:ok, Glific.Messages.Message.t()} | {:error, String.t()}

Send message to receiver using define provider.

Link to this function

update_provider_status(provider_message_id, provider_status, errors)

View Source

Specs

update_provider_status(String.t(), atom(), map()) ::
  {:ok, Glific.Messages.Message.t()}

Callback to update the provider status for a message