vue-email-editor icon indicating copy to clipboard operation
vue-email-editor copied to clipboard

editor.registerCallback not working in load event

Open oguzhanmemis7849 opened this issue 10 months ago • 6 comments

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

oguzhanmemis7849 avatar Feb 03 '25 14:02 oguzhanmemis7849

Same problem. If you change the editor version to 1.157.0, everything works. Looks like this feature is now paid too

kchebot avatar Feb 03 '25 15:02 kchebot

@kchebot how do you set the editor version? I can't find anything in the docs or project types

Same problem. If you change the editor version to 1.157.0, everything works. Looks like this feature is now paid too

filipecrosk avatar Feb 03 '25 19:02 filipecrosk

@kchebot how can we revert to unlayer version 1.157.0? Since we are using it via vue-email-editor, unlayer is marked as latest.

oguzhanmemis7849 avatar Feb 04 '25 05:02 oguzhanmemis7849

Here's a link to the documentation https://docs.unlayer.com/builder/version-management

In vue-email-editor you need to pass version: "1.157.0" in the editor instance options

kchebot avatar Feb 04 '25 08:02 kchebot

@kchebot Thank you.

oguzhanmemis7849 avatar Feb 04 '25 10:02 oguzhanmemis7849

Are you trying to do this?

mrcego avatar Feb 10 '25 14:02 mrcego