Skip to main content
Glama

mcp-google-sheets

send-draft-email.ts974 B
import { createAction } from '@activepieces/pieces-framework'; import { Client } from '@microsoft/microsoft-graph-client'; import { microsoftOutlookAuth } from '../common/auth'; import { draftMessageIdDropdown } from '../common/props'; export const sendDraftEmailAction = createAction({ auth: microsoftOutlookAuth, name: 'sendDraftEmail', displayName: 'Send Draft Email', description: 'Sends a draft email message.', props: { messageId: draftMessageIdDropdown({ displayName: 'Draft Email', description: 'Select the draft email message to send.', required: true, }), }, async run(context) { const { messageId } = context.propsValue; const client = Client.initWithMiddleware({ authProvider: { getAccessToken: () => Promise.resolve(context.auth.access_token), }, }); await client.api(`/me/messages/${messageId}/send`).post({}); return { success: true, message: 'Draft sent successfully.', messageId: messageId, }; }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server