Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerCallback with selectImage stopped working #435

Open
Arsenalist opened this issue Nov 19, 2024 · 5 comments
Open

registerCallback with selectImage stopped working #435

Arsenalist opened this issue Nov 19, 2024 · 5 comments

Comments

@Arsenalist
Copy link

This is in react:

  import EmailEditor, { UnlayerOptions } from "react-email-editor";

  ...

  const internalOnReady = () => {
    emailEditorRef.current.editor.registerCallback("selectImage", (a, b) =>
      console.log("registering callback"),
    );
  };

  ...

<EmailEditor ref={emailEditorRef} onReady={internalOnReady} />

The selectImage callback is not called when clicking the Image upload button. This used to work fine a few days ago.

@realirfanashraf
Copy link

realirfanashraf commented Dec 5, 2024

If you're looking to upload an image , you can use the 'image' option instead of 'selectImage'. This allows you to handle image uploads. You can refer to the (https://docs.unlayer.com/docs/custom-file-storage) for detailed instructions.

@Arsenalist
Copy link
Author

Thank you, I believe the code you posted is for changing the storage of the image, not replacing the picker.

I want to replace the image picker and uploader. The code I posted above was working perfectly fine until recently, but now selectImage event seems to have no effect. Keep in mind that I am on the free version but again this worked perfectly fine.

@realirfanashraf
Copy link

You're very welcome!

@Arsenalist
Copy link
Author

So is there a way to still replace the picker?

@realirfanashraf
Copy link

I'm unsure about that; my requirement was to upload the images to my server instead of Unlayer's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants