Skip to content

editor.registerCallback not working in load event #119

@oguzhanmemis7849

Description

@oguzhanmemis7849

Hello,

In our project using the vue-email-editor package with Vue, we encountered an issue where the registerCallback function inside the load event is not working properly.
We are using Vue3 and attempting to trigger the registerCallback within the onLoad function when the editor is loaded. However, the callback is not being registered as expected. The code is written as follows

const onLoad = () => {
  emailEditor.value.editor.registerCallback("image", async (file, done) => {
    const formData = new FormData();
    formData.append("document", file.attachments[0]);
    const response = await mailStore.contentFileUpload(formData);
    done({ progress: 100, url: response.ContentFileUrl });
  });
};

EmailEditor.mt-3(
    ref="emailEditor",
    :locale="'tr'",
    :tools="tools",
    @load="onLoad",
    @ready="editorReady"
  )

Even though this function is triggered, registerCallback does not seem to register the image callback, which is causing issues in our integration.

Steps to Reproduce:

  1. Installed vue-email-editor with Vue3.
  2. Implemented the load event to register an image callback.
  3. Tried to trigger the callback within the editor.
  4. Encountered the issue where the registerCallback is not working.

Expected Behavior:
We expect that the registerCallback method should register the callback function for the image upload, allowing us to upload images to our own file storage instead of using Unlayer's default S3 service.

Environment Information:

  • vue-email-editor version: 2.1.4
  • Vue version: 3.2.45
  • Node.js version: 18.20.5
  • Browser: Google Chrome Version 132.0.6834.84 (Official Build) (64-bit)
  • OS: Windows 11 Pro 64-bit

Could you please help us resolve this issue? This problem has been happening for about a week. Before that, the registerCallback method was working.

Thank you,
Oguzhan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions