Support for link to an element (href="#element") #1725
tea-lover-418
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
What was the email client you tested on that changed the href like that? Or was it React Email/React that did it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Some features this would enable:
Background
I build newsletters using react-email, and mostly I really love it.
However, the emails can get very long, and to engage readers I'd like to highlight stories at the top for them to scroll to on click. This can easily be done in plain html like this:
In emails, using id for this does not seem to be supported. No biggy, because the old fashioned
name
attribute does work.However, setting this attribute dynamically is turning out to be near impossible. Setting the
name
attribute is hard, and hacking it onto it makes values not properly align. This is because the actual email has thehref
andid
with value "element" transformed into "#m_-5288444870739175237_element", yet thename
attribute remains "element".Hacking this using an inspector shows that the setup would work.
Is there something we can do inside react-email to handle this? Some special
<ScrollAnchor>
component or special attribute?Proposal
I'd love to contribute if you can direct me what could be done.
Beta Was this translation helpful? Give feedback.
All reactions