unlayer/vue-email-editor

How do you enable Form tool?

mlanders opened this issue · 2 comments

Having an issue getting forms to work with the Vue component. Does it need to be in display mode web, or is it supported in email?

The documentation show enabling forms as the following.

unlayer.init({
  tools: {
    form: {
      enabled: false
    }
  }
});

However when trying to enable it via the tools props it doesn't show up.

<EmailEditor ref="documentEditor" :options="options" :tools="tools" @load="editorLoaded" />

The following is from the example which also does not work.

      tools: {
        form: {
          properties: {
            action: {
              editor: {
                data: {
                  actions: [
                    {
                      label: "Marketing",
                      method: "POST",
                      url: "http://whatever.com/marketing-form-submission",
                    },
                    {
                      label: "Sales",
                      method: "POST",
                      target: "_blank",
                      url: "http://whatever.com/sales-form-submission",
                    },
                  ],
                },
              },
            },
          },
        },
     }

Got it to work by modifying the display mode in the package and rebuilding it.

Got a PR in for this #30