Skip to content

Feat(email): "Sent with Macro" signature for free users#581

Merged
dev-rb merged 48 commits intomainfrom
rahul/comms-63-sent-with-macro-signature-on-emails
Dec 15, 2025
Merged

Feat(email): "Sent with Macro" signature for free users#581
dev-rb merged 48 commits intomainfrom
rahul/comms-63-sent-with-macro-signature-on-emails

Conversation

@dev-rb
Copy link
Copy Markdown
Contributor

@dev-rb dev-rb commented Dec 11, 2025

Summary

Adds a simple text signature to the end of an email before submission. This only applies for free tier users.

Adds a new Watermark lexical node for displaying content that cannot be removed. Also, handles transforming the node to a <m-watermark> xml node for serialization and to allow styling when displaying in macro

Todo: Make this more customizable. Should allow images and formatted content

Screenshots, GIFs, and Videos

Screenshot 2025-12-11 at 5 41 39 PM Screenshot 2025-12-11 at 5 42 01 PM

Tooltip
Screenshot 2025-12-12 at 1 41 59 PM

Paywall message
Screenshot 2025-12-12 at 1 40 52 PM

@dev-rb dev-rb requested a review from a team as a code owner December 11, 2025 22:44
@linear
Copy link
Copy Markdown

linear bot commented Dec 11, 2025

import { MarkNode } from '@lexical/mark';
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
import { WatermarkNode } from '@lexical-core/nodes/WatermarkNode';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, we can't use aliased imports within lexical-core. this package gets used in cloudflare workers which build and resolve outside of the app tsconfig

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, TIL

import type {
WatermarkDecoratorProps,
WatermarkNode,
} from '@lexical-core/nodes/WatermarkNode';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see other comment about aliased imports

@@ -0,0 +1,10 @@
import type { WatermarkDecoratorProps } from '@lexical-core/nodes/WatermarkNode';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to relative import

editor.update(() => {
watermark.forceRemove();
});
}
Copy link
Copy Markdown
Contributor

@peterchinman peterchinman Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we adding and removing the Macro signature to Lexical editor, instead of adding it to the HTML, as we do with the appended reply? Does this need to live in Lexical-land? Am I right in assuming that we only attach this on send?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also want it in bodyMacro to render it with correct styling on re-import. we could also manually append that marco-markdown tag, but this seems cleaner to me in that it implicitly handled both

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For text only signatures we could just append it to the html but this is to be able to handle any type of valid signature that we might introduce in the future, like images and structured content.

Also, I had originally intended the lexical node to always be appended to the editor by default so we could just render the node in the editor and what you see is what would ship with the email. But it got complicated to handle navigation and making sure it's the last element, so that's still TODO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sedson not sure what you mean by re-import? Draft loading? This (at least currently) never hits a draft, only gets appended on email send.

I would think we don't want this in body_macro at all? body_macro is only used for rendering emails in macro-native style, whereas watermark seems like something we'd only really want to show to users outside of macro?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh okay @dev-rb, yea I buy that, sounds good. If we do someday want this in Lexical-land, seems worth keeping.

@peterchinman
Copy link
Copy Markdown
Contributor

nits:

  • I want an extra lh of spacing between the input area and the watermark.
  • I think we need some sort of tooltip on the watermark ("Subscribe to remove watermark") or some explanatory message on the subscription page it takes you to.
  • Superhuman hides their watermark behind an ellipsis (the ellipses you would use to reveal the reply structure), I wonder if we should do the same? It feels distracting to always see the watermark while composing an email.

@dev-rb
Copy link
Copy Markdown
Contributor Author

dev-rb commented Dec 12, 2025

nits:

  • I want an extra lh of spacing between the input area and the watermark.
  • I think we need some sort of tooltip on the watermark ("Subscribe to remove watermark") or some explanatory message on the subscription page it takes you to.
  • Superhuman hides their watermark behind an ellipsis (the ellipses you would use to reveal the reply structure), I wonder if we should do the same? It feels distracting to always see the watermark while composing an email.

@peterchinman

  • Added spacing
  • Added a tooltip and message on the paywall screen
  • Do you want it to be toggle-able or once you reveal the extra content it can't be hidden?

@peterchinman
Copy link
Copy Markdown
Contributor

Do you want it to be toggle-able or once you reveal the extra content it can't be hidden?

@dev-rb sorry, for now I think let's cut the ellipses. If we're going to include them it's going to be slightly more complicated, because they should be the same ellipses that append the Reply Structure to Lexical, when you're in an email thread.

@dev-rb
Copy link
Copy Markdown
Contributor Author

dev-rb commented Dec 12, 2025

Ah okay, I'll remove for now then

@dev-rb dev-rb merged commit 896c424 into main Dec 15, 2025
19 checks passed
@dev-rb dev-rb deleted the rahul/comms-63-sent-with-macro-signature-on-emails branch December 15, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants