arikchakma / maily.to

Craft beautiful emails effortlessly with Maily, the powerful email editor that ensures impeccable communication across all major clients.
https://maily.to
MIT License
1.44k stars 74 forks source link

How variables are supported in maily editor? #16

Closed chavda-bhavik closed 11 months ago

chavda-bhavik commented 11 months ago

Amazing project and idea team. I'm planning to build and add a similar kind of editor to my project. Everything looks sorted, just confused about how variables are supported in the editor.

Of course not stopping me from building an email editor like maily but curious to know how you have planned to support variables.

Thank you.

arikchakma commented 11 months ago

Hello Chavda,

I built this custom Variable Node extending the @tiptap/extension-mention plugin. And in the renderer, I am just rendering it as {{variableId}}

Cheers, Arik

chavda-bhavik commented 11 months ago

Got it, Arik. We can add variable with @ symbol.

If I want to show a menu with a list of variables available when @ is written, then what would be a good way to do it?

arikchakma commented 11 months ago

I am using tippy.js for it, you can also use it.

chavda-bhavik commented 11 months ago

Got it. Will check it out. Thanks Arik. Awesome project. 👍🏼