-
Notifications
You must be signed in to change notification settings - Fork 3
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
Emailer: preview HTML content before sending #324
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. To follow up on our conversation, I think that this is good for users who want to write custom HTML. However, we should use this in conjunction with something that just inserts some provided text into the body of a pre-selected template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job abstracting the messages using the translation functionality. I Like!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just have a couple questions on certain implementation.
> | ||
<Input.TextArea rows={6} placeholder="Email Body" /> | ||
<Input.TextArea rows={8} placeholder={t('body_placeholder')} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to set the row to 8? if the user has less than 8 lines, would it just show a bunch of white spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
form={sendEmailForm} | ||
onFinish={onFinishSendEmail} | ||
onValuesChange={(changedValues, _) => { | ||
if (changedValues.emailBody !== undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the emailBody is undefined, would we want to prompt the user to do anything? or just ignore until they input something that's valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! In this case, emailBody
would be undefined only when the user edits a field that's not the body, since changedValues
only contains fields that were modified when the user inputs something. This check is just to make sure we don't accidentally clear the body when the user modifies the subject.
Checklist
yarn run check
yarn run test
Why
Resolves #275
On the emailer page, add a toggle to preview email HTML before sending
This PR
Screenshots
Raw view:
Preview view:
Verification Steps