Feat(email): "Sent with Macro" signature for free users#581
Conversation
…-sent-with-macro-signature-on-emails
…m cpose email input
| 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'; |
There was a problem hiding this comment.
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
| import type { | ||
| WatermarkDecoratorProps, | ||
| WatermarkNode, | ||
| } from '@lexical-core/nodes/WatermarkNode'; |
There was a problem hiding this comment.
see other comment about aliased imports
| @@ -0,0 +1,10 @@ | |||
| import type { WatermarkDecoratorProps } from '@lexical-core/nodes/WatermarkNode'; | |||
| editor.update(() => { | ||
| watermark.forceRemove(); | ||
| }); | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
Ahh okay @dev-rb, yea I buy that, sounds good. If we do someday want this in Lexical-land, seems worth keeping.
|
nits:
|
|
@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. |
|
Ah okay, I'll remove for now then |
…ion to add watermark with cleanup return fn
…-sent-with-macro-signature-on-emails
…-sent-with-macro-signature-on-emails
…-sent-with-macro-signature-on-emails
Summary
Adds a simple text signature to the end of an email before submission. This only applies for free tier users.
Adds a new
Watermarklexical 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 macroTodo: Make this more customizable. Should allow images and formatted content
Screenshots, GIFs, and Videos
Tooltip

Paywall message
