io.outlookAPIinterface
Outlook API.
Properties (1)
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| addinStatus⚓︎ | boolean | x | Flag indicating the status of the Outlook Adapter. If |
20 Methods
attachmentFromJSON()⚓︎
(attachment: T42Attachment) => Attachment
Converts attachment object to Attachment with method getData() but without the parent property.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| attachment⚓︎ | T42Attachment | The raw attachment object to convert. |
createLocalEmail()⚓︎
(localEmailParams: LocalEmailParams) => Promise<Email>
Creates new local email.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| localEmailParams⚓︎ | LocalEmailParams | Parameters for the local email. |
Example
const email = await outlook.createLocalEmail({
sender: "emailAddress@mail.com",
to: "emailAddress@mail.com",
subject: "Sample body",
location: "$Inbox",
});
console.log(email);
emailFromJSON()⚓︎
newEmail()⚓︎
(emailParams?: EmailParams, options?: NewEmailOptions) => Promise<void>
Creates new email window.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| emailParams⚓︎ | EmailParams | x | Optional email parameters (recipients, subject, body, attachments, etc.). |
| options⚓︎ | NewEmailOptions | x | Optional callbacks and display settings. |
Example
await outlook.newEmail(
{
to: "emailAddress@mail.com",
subject: "Sample subject",
body: "Sample body",
attachments: [
{
fileName: "attachmentFileName.txt",
data: "Sample text",
},
],
},
{
onSent: (email) => console.log(email),
onCanceled: () => console.log("canceled"),
},
);
newTask()⚓︎
(taskParams?: TaskParams, options?: NewTaskOptions) => Promise<void>
Creates new task window.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| taskParams⚓︎ | TaskParams | x | Optional task parameters (subject, body, priority, etc.). |
| options⚓︎ | NewTaskOptions | x | Optional callbacks and display settings. |
Example
await outlook.newTask(
{
subject: "Sample subject",
body: "Sample body",
priority: "high",
dueDate: new Date("2017-07-01"),
},
{
onSaved: (task) => console.log(task),
onCanceled: () => console.log("canceled"),
},
);
onAddinStatusChanged()⚓︎
(callback: (args: { connected: boolean }) => any) => () => void
Notifies when the Outlook Adapter status has changed. Immediately invokes the callback with the current status. Returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (args: { connected: boolean }) => any | Callback function for handling the event.
Receives as an argument an object with a |
Example
outlook.onAddinStatusChanged(({ connected }) => {
console.log(`Outlook is ${connected ? "available" : "unavailable"}.`);
});
onEmailReceived()⚓︎
(callback: (email: Email) => any) => void
Notifies when an email is received in the HandleEmail folder. Returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (email: Email) => any | Callback function for handling the event. Receives the received email as an argument. |
Example
outlook.onEmailReceived((email) =>
console.log("An email was received.", email),
);
onTaskCreated()⚓︎
(callback: (task: Task) => any) => void
Notifies when a task is created. Returns an unsubscribe function.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (task: Task) => any | Callback function for handling the event. Receives the created task as an argument. |
Example
outlook.onTaskCreated((task) => console.log("A task was created.", task));
onTrackCalendarEvent()⚓︎
(callback: (args: { conversationIds: T42Id[], event: T42Appointment | T42Meeting }) => any) => void
Notifies when an appointment or meeting gets tracked. Returns an unsubscribe function. Only one subscriber is allowed at a time.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (args: { conversationIds: T42Id[], event: T42Appointment | T42Meeting }) => any | Callback function for handling the event. Receives an object with |
onTrackEmail()⚓︎
Notifies when an email gets tracked. Returns an unsubscribe function. Only one subscriber is allowed at a time.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (args: { conversationIds: T42Id[], email: Email }) => any | Callback function for handling the event. Receives an object with |
onUntrackCalendarEvent()⚓︎
Notifies when an appointment or meeting gets untracked. Returns an unsubscribe function. Only one subscriber is allowed at a time.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (args: { conversationIds: T42Id[], eventIds: T42Id[] }) => any | Callback function for handling the event. Receives an object with |
onUntrackEmail()⚓︎
Notifies when an email gets untracked. Returns an unsubscribe function. Only one subscriber is allowed at a time.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| callback⚓︎ | (args: { conversationIds: T42Id[], emailIds: T42Id[] }) => any | Callback function for handling the event. Receives an object with |
showEmail()⚓︎
Shows email in Outlook.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| ids⚓︎ | T42Id[] | The identifiers of the email to show. |
Example
await outlook.newEmail(
{
to: "emailAddress@mail.com",
subject: "Sample subject",
body: "Sample body",
},
{
onSent: async (email) => {
const ids = await outlook.showEmail(email.ids);
console.log(ids);
},
},
);
showTask()⚓︎
taskFromJSON()⚓︎
trackCalendarEvent()⚓︎
(event: T42Appointment | T42Meeting, conversationId?: T42Id) => Promise<{
event: T42Appointment | T42Meeting,
conversationIds: T42Id[],
}>
Tracks appointment or meeting.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| event⚓︎ | T42Appointment | T42Meeting | The appointment or meeting to track. |
|
| conversationId⚓︎ | T42Id | x | Optional conversation identifier. |
untrackCalendarEvent()⚓︎
(event: T42Appointment | T42Meeting) => Promise<{ event: T42Appointment | T42Meeting }>
Untracks appointment or meeting.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| event⚓︎ | T42Appointment | T42Meeting | The appointment or meeting to untrack. |