Skip to content

Commit

Permalink
refactor: modify generateEmailHtml() parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pmjuu committed Feb 19, 2025
1 parent 9ca83d7 commit 2924107
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/email-templates/confirm-email.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Context } from 'hono';

export function generateEmailHtml(context: Context<EnvironmentBindings>, token: string) {
const activationUrl = `${context.env.BASE_URL}/auth/activate?token=${token}`;
const logoUrl = `${context.env.BASE_URL}/assets/torontojs-logo.png`;
export function generateEmailHtml(baseUrl: string, token: string) {
const activationUrl = `${baseUrl}/auth/activate?token=${token}`;
const logoUrl = `${baseUrl}/assets/torontojs-logo.png`;

return `
<!doctype html>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ authRoutes.post('/sign-up', async (context: Context<EnvironmentBindings>) => {
{ expirationTtl: 60 * 10 }
);

const emailHtmlTemplate = generateEmailHtml(context, encodedToken);
const emailHtmlTemplate = generateEmailHtml(context.env.BASE_URL, encodedToken);
const msg = {
to: parsedBody.email,
from: context.env.SENDER_EMAIL,
Expand Down

0 comments on commit 2924107

Please sign in to comment.