mirror of
https://github.com/documenso/documenso.git
synced 2026-07-27 18:35:05 +10:00
chore: restore dangling changes from rebase
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
|
||||
import { User } from "@prisma/client";
|
||||
|
||||
export const resetPasswordSuccessTemplate = (user: User) => {
|
||||
return `
|
||||
<div style="background-color: #eaeaea; padding: 2%;">
|
||||
<div
|
||||
style="text-align:left; margin: auto; font-size: 14px; color: #353434; max-width: 500px; border-radius: 0.375rem; background: white; padding: 50px">
|
||||
<img src="${NEXT_PUBLIC_WEBAPP_URL}/logo_h.png" alt="Documenso Logo"
|
||||
style="width: 180px; display: block; margin-bottom: 14px;" />
|
||||
|
||||
<h2 style="text-align: left; margin-top: 20px; font-size: 24px; font-weight: bold">Password updated!</h2>
|
||||
|
||||
<p style="margin-top: 15px">
|
||||
Hi ${user.name ? user.name : user.email},
|
||||
</p>
|
||||
|
||||
<p style="margin-top: 15px">
|
||||
We've changed your password as you asked. You can now sign in with your new password.
|
||||
</p>
|
||||
|
||||
<p style="margin-top: 15px">
|
||||
Didn't request a password change? We are here to help you secure your account, just <a href="https://documenso.com">contact us</a>.
|
||||
</p>
|
||||
|
||||
<p style="margin-top: 15px">
|
||||
<p style="font-weight: bold">
|
||||
The Documenso Team
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p style="text-align:left; margin-top: 30px">
|
||||
<small>Want to send you own signing links?
|
||||
<a href="https://documenso.com">Hosted Documenso is here!</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: left; line-height: 18px; color: #666666; margin: 24px">
|
||||
<div style="margin-top: 12px">
|
||||
<b>Need help?</b>
|
||||
<br>
|
||||
Contact us at <a href="mailto:hi@documenso.com">hi@documenso.com</a>
|
||||
</div>
|
||||
<hr size="1" style="height: 1px; border: none; color: #D8D8D8; background-color: #D8D8D8">
|
||||
<div style="text-align: center">
|
||||
<small>Easy and beautiful document signing by Documenso.</small>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
};
|
||||
export default resetPasswordSuccessTemplate;
|
||||
@@ -1,46 +0,0 @@
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
|
||||
|
||||
export const resetPasswordTemplate = (ctaLink: string, ctaLabel: string) => {
|
||||
const customContent = `
|
||||
<h2 style="margin-top: 36px; font-size: 24px; font-weight: bold;">Forgot your password?</h2>
|
||||
<p style="margin-top: 8px;">
|
||||
That's okay, it happens! Click the button below to reset your password.
|
||||
</p>
|
||||
|
||||
<p style="margin: 30px 0px; text-align: center">
|
||||
<a href="${ctaLink}" style="background-color: #37f095; white-space: nowrap; color: white; border-color: transparent; border-width: 1px; border-radius: 0.375rem; font-size: 18px; padding-left: 16px; padding-right: 16px; padding-top: 10px; padding-bottom: 10px; text-decoration: none; margin-top: 4px; margin-bottom: 4px;">
|
||||
${ctaLabel}
|
||||
</a>
|
||||
</p>
|
||||
<p style="margin-top: 20px;">
|
||||
<small>Want to send you own signing links? <a href="https://documenso.com">Hosted Documenso is here!</a>.</small>
|
||||
</p>`;
|
||||
|
||||
const html = `
|
||||
<div style="background-color: #eaeaea; padding: 2%;">
|
||||
<div
|
||||
style="text-align:center; margin: auto; font-size: 14px; color: #353434; max-width: 500px; border-radius: 0.375rem; background: white; padding: 50px">
|
||||
<img src="${NEXT_PUBLIC_WEBAPP_URL}/logo_h.png" alt="Documenso Logo"
|
||||
style="width: 180px; display: block; margin: auto; margin-bottom: 14px;" />
|
||||
${customContent}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const footer = `
|
||||
<div style="text-align: left; line-height: 18px; color: #666666; margin: 24px">
|
||||
<div style="margin-top: 12px">
|
||||
<b>Need help?</b>
|
||||
<br>
|
||||
Contact us at <a href="mailto:hi@documenso.com">hi@documenso.com</a>
|
||||
</div>
|
||||
<hr size="1" style="height: 1px; border: none; color: #D8D8D8; background-color: #D8D8D8">
|
||||
<div style="text-align: center">
|
||||
<small>Easy and beautiful document signing by Documenso.</small>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
return html + footer;
|
||||
};
|
||||
|
||||
export default resetPasswordTemplate;
|
||||
@@ -1,14 +0,0 @@
|
||||
import { resetPasswordTemplate } from "@documenso/lib/mail";
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from "../constants";
|
||||
import { sendMail } from "./sendMail";
|
||||
import { User } from "@prisma/client";
|
||||
|
||||
export const sendResetPassword = async (user: User, token: string) => {
|
||||
await sendMail(
|
||||
user.email,
|
||||
"Forgot password?",
|
||||
resetPasswordTemplate(`${NEXT_PUBLIC_WEBAPP_URL}/auth/reset/${token}`, "Reset Your Password")
|
||||
).catch((err) => {
|
||||
throw err;
|
||||
});
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
import resetPasswordSuccessTemplate from "./resetPasswordSuccessTemplate";
|
||||
import { sendMail } from "./sendMail";
|
||||
import { User } from "@prisma/client";
|
||||
|
||||
export const sendResetPasswordSuccessMail = async (user: User) => {
|
||||
await sendMail(user.email, "Password Reset Success!", resetPasswordSuccessTemplate(user)).catch(
|
||||
(err) => {
|
||||
throw err;
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -4,6 +4,7 @@ import { mailer } from '@documenso/email/mailer';
|
||||
import { render } from '@documenso/email/render';
|
||||
import { DocumentInviteEmailTemplate } from '@documenso/email/templates/document-invite';
|
||||
import { FROM_ADDRESS, FROM_NAME } from '@documenso/lib/constants/email';
|
||||
import { renderCustomEmailTemplate } from '@documenso/lib/utils/render-custom-email-template';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
import { DocumentStatus, SendStatus } from '@documenso/prisma/client';
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* getAssetBuffer is used to retrieve array buffers for various assets
|
||||
* that are hosted in the `public` folder.
|
||||
*
|
||||
* This exists due to a breakage with `import.meta.url` imports and open graph images,
|
||||
* once we can identify a fix for this, we can remove this helper.
|
||||
*
|
||||
* @param path The path to the asset, relative to the `public` folder.
|
||||
*/
|
||||
export const getAssetBuffer = async (path: string) => {
|
||||
const baseUrl = process.env.NEXT_PUBLIC_WEBAPP_URL || 'http://localhost:3000';
|
||||
|
||||
return fetch(new URL(path, baseUrl)).then(async (res) => res.arrayBuffer());
|
||||
};
|
||||
Reference in New Issue
Block a user