Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Message

The Message object can be used to create and send mail iMessages, similar to those created by a "Message" action step.

Examples

var msg = Message.create();
msg.toRecipients = ["joe@sample.com"];
msg.subject = "My test message";
msg.body = "Body text";

var success = msg.send();

Hierarchy

  • Message

Index

Properties

body

body: string

Body text of the mail message.

isSent

isSent: boolean

true/false flag indicated if the message object has already been sent.

status

status: "created" | "sent" | "messagesUnavailable" | "userCancelled" | "unknownError"

One of the following strings

  • created: Initial value before send() has been called.
  • sent: The message was sent successfully.
  • messagesUnavailable: On iOS, Mail.app services were not available.
  • userCancelled: The user cancelled the Mail.app window without sending.
  • unknownError: An unknown error occurred.

subject

subject: string

Subject line. Only used if subject is enabled in Messages settings on the device.

toRecipients

toRecipients: string[]

Array of phone numbers and email addresses to use as To: recipients.

Methods

send

  • send(): boolean
  • Send the message. This will open the Messages.app sending window. Returns true if the message was sent successfully or false if not - if, for example, the user cancelled the message window.

    Returns boolean

Static create

  • Instantiate Message object

    Returns Message

Generated using TypeDoc