UNPKG

@pipedream/microsoft_outlook

Version:

Pipedream Microsoft Outlook Components

56 lines (54 loc) 1.48 kB
import microsoftOutlook from "../../microsoft_outlook.app.mjs"; export default { key: "microsoft_outlook-move-email-to-folder", name: "Move Email to Folder", description: "Moves an email to the specified folder in Microsoft Outlook. [See the documentation](https://learn.microsoft.com/en-us/graph/api/message-move)", version: "0.0.23", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: false, }, type: "action", props: { microsoftOutlook, userId: { propDefinition: [ microsoftOutlook, "userId", ], optional: true, description: "The User ID of a shared mailbox. If not provided, defaults to the authenticated user's mailbox.", }, messageId: { propDefinition: [ microsoftOutlook, "messageId", ({ userId }) => ({ userId, }), ], }, folderId: { propDefinition: [ microsoftOutlook, "folderIds", ], type: "string", label: "Folder ID", description: "The identifier of the folder to move the selected message to", }, }, async run({ $ }) { const response = await this.microsoftOutlook.moveMessage({ $, userId: this.userId, messageId: this.messageId, data: { destinationId: this.folderId, }, }); $.export("$summary", `Successfully moved email to folder with ID: ${this.folderId}`); return response; }, };