-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(utils): add text email generation utility methods #65
Merged
agentmilindu
merged 4 commits into
main
from
feat/60-implement-text-email-generation-utility-based-on-email-templates
Jul 21, 2022
Merged
feat(utils): add text email generation utility methods #65
agentmilindu
merged 4 commits into
main
from
feat/60-implement-text-email-generation-utility-based-on-email-templates
Jul 21, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think you need to have tests for all types of components we have to make sure all the components turn to the correct text version of them. |
Yeah, make sense, doing the changes. |
niloysikdar
added
the
GSoC 2022
Issues and Pull Requests under Google Summer of Code 2022
label
Jul 16, 2022
…o feat/60-implement-text-email-generation-utility-based-on-email-templates
niloysikdar
force-pushed
the
feat/60-implement-text-email-generation-utility-based-on-email-templates
branch
from
July 18, 2022 08:18
5b88eee
to
e67a321
Compare
Add some more missing tests for all of the components for generateTextEmail method Resolves #60 Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
niloysikdar
force-pushed
the
feat/60-implement-text-email-generation-utility-based-on-email-templates
branch
from
July 20, 2022 14:03
e67a321
to
7c61682
Compare
agentmilindu
approved these changes
Jul 21, 2022
agentmilindu
deleted the
feat/60-implement-text-email-generation-utility-based-on-email-templates
branch
July 21, 2022 05:06
🎉 This PR is included in version 1.7.0 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements:
generateTextEmailFromHTML
function which will take the HTML string and convert it to plaintext versiongenerateTextEmail
function which will accept the JSX Layout and convert that into plaintext format usinggenerateEmail
andgenerateTextEmailFromHTML
functionsThe Pull Request covers:
generateTextEmailFromHTML
utility functiongenerateTextEmail
functiongenerateTextEmailFromHTML
andgenerateTextEmail
methodsLimitations:
Some proposed solutions:
We tried using some HOC and complex logic strategy with some props
(mode = "text")
to handle the functionality of not rendering the text from the Preheader, but it was throwing issues for some cases and moreover, it was only increasing the complexity in case of implementation.We can remove the Preheader manually from our DOM and then generate the text version, and this won't add the preheader text to the final generated text.
I've found another library html-to-text that can help us to achieve this goal. We can use the
selectors
option to pass our custom selector for the Preheader component and then exclude it from the final generated text.But the only problem with this library is that we also need to define our custom selectors and formatters for all
h
tags to hashify them in the generated text output.Resolves #60
Signed-off-by: Niloy Sikdar niloysikdar30@gmail.com