GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
614 stars 217 forks source link

Create custom MJML component #352

Open mabonoah opened 2 months ago

mabonoah commented 2 months ago

Hello everyone,

I'm using the following version with an Angular 7 project:

I want to create a custom mjml component like mj-text built-in components. I have tried multiple ways but they are not working with me and I didn't find enough resources.

Please any help.

adrianodias8 commented 2 months ago

Hi there!

I also have been playing with components and specifically for preview text i can give you my 2 cents from my investigation

here is my ticket: https://github.com/GrapesJS/mjml/issues/351 (very basic component test that i did)

regarding documentation i recommend you to check components folder to understand the structure https://github.com/GrapesJS/mjml/tree/master/src/components

also check the base component from base repo here: https://github.com/GrapesJS/grapesjs/blob/dev/src/dom_components/model/Component.ts

this is just the mjml plugin
and read this : https://grapesjs.com/docs/modules/Components.html (components) https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components (traits)

I hope this helps and points you in the right direction.

best, Adriano Dias