mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 10:16:32 +02:00
💬 Update email subject lines (#652)
This commit is contained in:
parent
da97c94012
commit
38454302b3
6 changed files with 15 additions and 10 deletions
|
@ -76,7 +76,9 @@ test.describe.parallel(() => {
|
||||||
wait: 5000,
|
wait: 5000,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(email.headers.subject).toBe("Response submitted for Lunch Meeting");
|
expect(email.headers.subject).toBe(
|
||||||
|
"Thanks for responding to Lunch Meeting",
|
||||||
|
);
|
||||||
|
|
||||||
const $ = load(email.html);
|
const $ = load(email.html);
|
||||||
const href = $("#editSubmissionUrl").attr("href");
|
const href = $("#editSubmissionUrl").attr("href");
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
"name": "@rallly/backend",
|
"name": "@rallly/backend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"lint:tsc": "tsc --noEmit"
|
||||||
|
},
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -10,7 +10,7 @@ declare module "iron-session" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const decryptToken = async <P = UserSessionData>(
|
export const decryptToken = async <P extends Record<string, unknown>>(
|
||||||
token: string,
|
token: string,
|
||||||
): Promise<P | null> => {
|
): Promise<P | null> => {
|
||||||
const payload = await unsealData(token, {
|
const payload = await unsealData(token, {
|
||||||
|
@ -23,7 +23,7 @@ export const decryptToken = async <P = UserSessionData>(
|
||||||
return payload as P;
|
return payload as P;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createToken = async <T = UserSessionData>(
|
export const createToken = async <T extends Record<string, unknown>>(
|
||||||
payload: T,
|
payload: T,
|
||||||
options?: {
|
options?: {
|
||||||
ttl?: number;
|
ttl?: number;
|
||||||
|
|
|
@ -84,7 +84,7 @@ export const auth = router({
|
||||||
return { ok: false, reason: "userAlreadyExists" };
|
return { ok: false, reason: "userAlreadyExists" };
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = await generateOtp();
|
const code = generateOtp();
|
||||||
|
|
||||||
const token = await createToken<RegistrationTokenPayload>({
|
const token = await createToken<RegistrationTokenPayload>({
|
||||||
name: input.name,
|
name: input.name,
|
||||||
|
@ -94,7 +94,7 @@ export const auth = router({
|
||||||
|
|
||||||
await sendEmail("RegisterEmail", {
|
await sendEmail("RegisterEmail", {
|
||||||
to: input.email,
|
to: input.email,
|
||||||
subject: "Please verify your email address",
|
subject: `${input.name}, please verify your email address`,
|
||||||
props: {
|
props: {
|
||||||
code,
|
code,
|
||||||
name: input.name,
|
name: input.name,
|
||||||
|
@ -171,7 +171,7 @@ export const auth = router({
|
||||||
return { ok: false, reason: "userNotFound" };
|
return { ok: false, reason: "userNotFound" };
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = await generateOtp();
|
const code = generateOtp();
|
||||||
|
|
||||||
const token = await createToken<LoginTokenPayload>({
|
const token = await createToken<LoginTokenPayload>({
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
|
@ -180,7 +180,7 @@ export const auth = router({
|
||||||
|
|
||||||
await sendEmail("LoginEmail", {
|
await sendEmail("LoginEmail", {
|
||||||
to: input.email,
|
to: input.email,
|
||||||
subject: "Login",
|
subject: `${code} is your 6-digit code`,
|
||||||
props: {
|
props: {
|
||||||
name: user.name,
|
name: user.name,
|
||||||
code,
|
code,
|
||||||
|
|
|
@ -83,7 +83,7 @@ export const comments = router({
|
||||||
emailsToSend.push(
|
emailsToSend.push(
|
||||||
sendEmail("NewCommentEmail", {
|
sendEmail("NewCommentEmail", {
|
||||||
to: email,
|
to: email,
|
||||||
subject: `New comment on ${poll.title}`,
|
subject: `${authorName} has commented on ${poll.title}`,
|
||||||
props: {
|
props: {
|
||||||
name: watcher.user.name,
|
name: watcher.user.name,
|
||||||
authorName,
|
authorName,
|
||||||
|
|
|
@ -101,7 +101,7 @@ export const participants = router({
|
||||||
emailsToSend.push(
|
emailsToSend.push(
|
||||||
sendEmail("NewParticipantConfirmationEmail", {
|
sendEmail("NewParticipantConfirmationEmail", {
|
||||||
to: email,
|
to: email,
|
||||||
subject: `Response submitted for ${poll.title}`,
|
subject: `Thanks for responding to ${poll.title}`,
|
||||||
props: {
|
props: {
|
||||||
name,
|
name,
|
||||||
title: poll.title,
|
title: poll.title,
|
||||||
|
@ -138,7 +138,7 @@ export const participants = router({
|
||||||
emailsToSend.push(
|
emailsToSend.push(
|
||||||
sendEmail("NewParticipantEmail", {
|
sendEmail("NewParticipantEmail", {
|
||||||
to: email,
|
to: email,
|
||||||
subject: `New response for ${poll.title}`,
|
subject: `${participant.name} has responded to ${poll.title}`,
|
||||||
props: {
|
props: {
|
||||||
name: watcher.user.name,
|
name: watcher.user.name,
|
||||||
participantName: participant.name,
|
participantName: participant.name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue