[GH-ISSUE #16] How variables are supported in maily editor? #239

Closed
opened 2026-03-15 01:52:45 +03:00 by kerem · 12 comments
Owner

Originally created by @chavda-bhavik on GitHub (Sep 20, 2023).
Original GitHub issue: https://github.com/arikchakma/maily.to/issues/16

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.

Originally created by @chavda-bhavik on GitHub (Sep 20, 2023). Original GitHub issue: https://github.com/arikchakma/maily.to/issues/16 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.
kerem closed this issue 2026-03-15 01:52:51 +03:00
Author
Owner

@arikchakma commented on GitHub (Sep 20, 2023):

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

<!-- gh-comment-id:1726830822 --> @arikchakma commented on GitHub (Sep 20, 2023): Hello Chavda, I built this custom [Variable Node](https://github.com/arikchakma/maily.to/blob/main/components/editor/nodes/variable.tsx) extending the `@tiptap/extension-mention` plugin. And in the renderer, I am just rendering it as [{{variableId}}](https://github.com/arikchakma/maily.to/blob/3a8dde8cfc4b78bb3c1f39d8f853ed9e213d4958/components/editor/utils/email.ts#L410) Cheers, Arik
Author
Owner

@chavda-bhavik commented on GitHub (Sep 20, 2023):

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?

<!-- gh-comment-id:1727832237 --> @chavda-bhavik commented on GitHub (Sep 20, 2023): 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?
Author
Owner

@arikchakma commented on GitHub (Sep 20, 2023):

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

<!-- gh-comment-id:1727836938 --> @arikchakma commented on GitHub (Sep 20, 2023): I am using `tippy.js` for it, you can also use it.
Author
Owner

@chavda-bhavik commented on GitHub (Sep 20, 2023):

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

<!-- gh-comment-id:1727840167 --> @chavda-bhavik commented on GitHub (Sep 20, 2023): Got it. Will check it out. Thanks Arik. Awesome project. 👍🏼
Author
Owner

@vrabota commented on GitHub (Dec 23, 2025):

@arikchakma Can we use variables for subject as well?

<!-- gh-comment-id:3685944564 --> @vrabota commented on GitHub (Dec 23, 2025): @arikchakma Can we use variables for subject as well?
Author
Owner

@arikchakma commented on GitHub (Dec 23, 2025):

Image

In the Maily Platform, yes you can.

<!-- gh-comment-id:3685998260 --> @arikchakma commented on GitHub (Dec 23, 2025): <img width="732" height="232" alt="Image" src="https://github.com/user-attachments/assets/529440e9-bba3-4c0d-bd3d-8228d395e16a" /> In the Maily Platform, yes you can.
Author
Owner

@vrabota commented on GitHub (Dec 23, 2025):

Your subject here is Test Components

<!-- gh-comment-id:3686039247 --> @vrabota commented on GitHub (Dec 23, 2025): Your subject here is `Test Components`
Author
Owner

@arikchakma commented on GitHub (Dec 23, 2025):

Ah the subject is for only the naming (title of the template) the bottom one is the preview header. Currently we can't add variables in the Subject.

<!-- gh-comment-id:3686044046 --> @arikchakma commented on GitHub (Dec 23, 2025): Ah the subject is for only the naming (title of the template) the bottom one is the preview header. Currently we can't add variables in the Subject.
Author
Owner

@vrabota commented on GitHub (Dec 23, 2025):

What is the difference here between Subject and Preview header?
Is that subject will be send to email provider as well? or you use it just internally?

One more question is related how we set values for this variables from backend, for ex: we have variable {{user}} and from our backend and database when we need to send the email we want to set it to Joe.
Or we just set at template level {{user}} and provider like Resend should handle this logic to convert it?

<!-- gh-comment-id:3686059855 --> @vrabota commented on GitHub (Dec 23, 2025): What is the difference here between Subject and Preview header? Is that subject will be send to email provider as well? or you use it just internally? One more question is related how we set values for this variables from backend, for ex: we have variable `{{user}}` and from our backend and database when we need to send the email we want to set it to `Joe`. Or we just set at template level `{{user}}` and provider like Resend should handle this logic to convert it?
Author
Owner

@arikchakma commented on GitHub (Dec 23, 2025):

Either you can use our template rendering api(paid) or you can export into html then replace the variables from your backend.

<!-- gh-comment-id:3686071225 --> @arikchakma commented on GitHub (Dec 23, 2025): Either you can use our template rendering api(paid) or you can export into html then replace the variables from your backend.
Author
Owner

@vrabota commented on GitHub (Dec 23, 2025):

I need to store JSON template in DB with variables and when we need to send the email, we need to extract data from DB, replace variables and send email

<!-- gh-comment-id:3686081486 --> @vrabota commented on GitHub (Dec 23, 2025): I need to store JSON template in DB with variables and when we need to send the email, we need to extract data from DB, replace variables and send email
Author
Owner

@arikchakma commented on GitHub (Dec 23, 2025):

Yeah that is one way to do it.

<!-- gh-comment-id:3686226185 --> @arikchakma commented on GitHub (Dec 23, 2025): Yeah that is one way to do it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/maily.to#239
No description provided.