-
Notifications
You must be signed in to change notification settings - Fork 88
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: Improve e-sign request flow and email logic #285
feat: Improve e-sign request flow and email logic #285
Conversation
Thank you for following the naming conventions for pull request titles! 🙏 |
@dahal I think it's ready for review. |
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.
Great work as always ❤️ 🚀 🚀 .
Here are some of my feedback and suggestions:
- Save as a draft is not working.
optional message
should be saved in the template model because ordered signing needs those values.- Maybe we can have an input for a custom
email subject
as well. We can save those optional values in thetemplate model
like"optional message" => emailBody
andemailSubject
. cc @dahal. - @dahal, should we allow
optional message
to be added to the draft as well? If so, rather than rendering a dropdown forSave & Continue
, we can render aPopover
that has all the inputs above and provide the user the option to complete or save as a draft.
emailPayload: z.object({ | ||
optionalMessage: z.string().optional(), | ||
expiryDate: z.date().or(z.null()).or(z.string()).optional(), | ||
documentName: z.string(), |
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.
documentName
,companyName
, completedOn
and companyLogo
should be queried from the backend no need to pass it on from the frontend
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.
@G3root Sure ! Thanks for the feedback.
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.
documentName
,companyName
,completedOn
andcompanyLogo
should be queried from the backend no need to pass it on from the frontend
I second that.
const closeModal = watch("closeModal"); | ||
|
||
// close modal is triggered from template-field-provider | ||
useEffect(() => { |
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 useEffect
should be avoided, and we don't need closeModal
. This would lead to some unexpected bugs and boilerplate code because we are syncing two states through a useEffect
. a form submit would close the modal.
recipient: z.string(), | ||
recipientColors: z.record(z.string()), | ||
emailPayload: z.object({ | ||
optionalMessage: z.string().optional(), | ||
expiryDate: z.date().or(z.null()).or(z.string()).optional(), |
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.
how are we handling expiryDate
? is it being used in the backend ?
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.
Currently we are just displaying it in email body only.
Do not have a clear idea. (Might be just for the information purpose)
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.
We will have the expiry on second iteration, lets remove for now
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.
Looking good, please go through the reviews and make necessary changes.
package.json
Outdated
@@ -130,6 +130,6 @@ | |||
"initVersion": "7.25.1" | |||
}, | |||
"trigger.dev": { | |||
"endpointId": "captable-A0-I" | |||
"endpointId": "opencap-WhPZ" |
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.
Do we need to hardcode this? Each contributors and env will have different ids
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.
No, i will fix it.
public/avatar.svg
Outdated
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.
We already have /public/placeholders/user.svg
, please remove this.
public/signature.svg
Outdated
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.
Please remove this, and if we need re-usable icon, create one on icons.tsx
name: payload.company.name, | ||
logo: | ||
payload.company.logo ?? | ||
"https://avatars.githubusercontent.com/u/163377635?s=48&v=4", |
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.
Why is this hardcoded?
src/emails/EsignEmail.tsx
Outdated
<Column align="left"> | ||
<Img | ||
className="rounded-full" | ||
src={"https://www.svgrepo.com/show/437226/signature.svg"} |
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.
Please dont hardcode these
src/emails/EsignEmail.tsx
Outdated
href={signingLink} | ||
> | ||
Sign document | ||
Esign the 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.
Esign the template | |
Sign the document |
src/emails/EsignEmail.tsx
Outdated
export default EsignEmail; | ||
<Hr className="mx-0 my-[26px] w-full border border-solid border-neutral-200" /> | ||
<Text className="mx-auto text-center text-[12px] leading-[24px] text-[#666666]"> | ||
If you were not expecting this email, you can ignore this email. |
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 you were not expecting this email, you can ignore this email. | |
Please ignore, if you were not expecting this email. |
return hour > 12; | ||
} | ||
|
||
export function getSanitizedDateTime(datetime: string) { |
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.
Please use @/common/dayjs
to sanitize these dates and timestamps
recipient: z.string(), | ||
recipientColors: z.record(z.string()), | ||
emailPayload: z.object({ | ||
optionalMessage: z.string().optional(), | ||
expiryDate: z.date().or(z.null()).or(z.string()).optional(), |
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.
We will have the expiry on second iteration, lets remove for now
return { | ||
success: false, | ||
message: "Email requires sender name , email and company logo.", | ||
}; |
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.
Let's not make company logo a requirement to eSign. We have a placeholder we can use if company logo is not available.
/public/placeholders/company.svg
Here are my thoughts
Yes,
For now, we can just limit to
We dont need to allow optional message on draft. Regarding popover, i have been experimenting it on Data room, i kind of like it. But for this use case, since modal is already implemented, lets limit message to |
fix: fix conflicts in add-fields-procedure
fix: conflict in get-signing-fields
aa0a2a3
to
23f0156
Compare
24a3b2e
to
971e083
Compare
PR for issue #273