diff --git a/packages/server/src/internals/server/enmeshed-middleware.ts b/packages/server/src/internals/server/enmeshed-middleware.ts index 2cb19864a..52b631ed9 100644 --- a/packages/server/src/internals/server/enmeshed-middleware.ts +++ b/packages/server/src/internals/server/enmeshed-middleware.ts @@ -479,7 +479,6 @@ function createEnmeshedWebhookMiddleware( } if (!sessionId) { - await sendWelcomeMessage({ relationship: data, client }) await sendAttributesChangeRequest({ relationship: data, client }) } } @@ -512,54 +511,6 @@ function createEnmeshedWebhookMiddleware( } } -/** - * Sends a welcome message with a test file attachment to be saved within the users' data wallet - */ -async function sendWelcomeMessage({ - relationship, - client, -}: { - relationship: Relationship - client: ConnectorClient -}): Promise { - const expiresAt = new Date() - expiresAt.setHours(expiresAt.getHours() + 1) - const uploadFileResponse = await client.files.uploadOwnFile({ - title: 'Serlo Testdatei', - description: 'Test file created by Serlo', - file: Buffer.from( - 'Serlo Testdatei

Hello World! - Dies ist eine Testdatei.

', - ), - filename: 'serlo-test.html', - expiresAt: expiresAt.toISOString(), - }) - - if (uploadFileResponse.isError) { - handleConnectorError({ - error: uploadFileResponse.error, - message: 'Failed to upload file in welcome message', - }) - } - - const sendMessageResponse = await client.messages.sendMessage({ - recipients: [relationship.peer], - content: { - '@type': 'Mail', - to: [relationship.peer], - subject: 'Danke für dein Vertrauen.', - body: 'Hallo!\nDanke für deine Anfrage, wir freuen uns über dein Vertrauen.\nDein Serlo-Team', - }, - attachments: [uploadFileResponse.result.id], - }) - - if (sendMessageResponse.isError) { - handleConnectorError({ - error: sendMessageResponse.error, - message: 'Failed to upload file in welcome message', - }) - } -} - /** * Requests user to change and share attributes in data wallet * Attributes will be sent to connector webhook after confirmation