Add username and email to feedback email (#3002)

* Add username and email to feedback email

* Fix type error
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2022-06-07 08:39:47 -06:00
1 parent e77ddc3d2e
commit 0f5550680a
3 files changed
+10 -6

No files matched your search

+2 -1
View File
@@ -895,7 +895,8 @@ const loggedInViewerRouter = createProtectedRouter()
const { rating, comment } = input;
const feedback = {
userId: ctx.user.id,
username: ctx.user.name || "Nameless",
email: ctx.user.email || "No email address",
rating: rating,
comment: comment,
};
@@ -1,7 +1,8 @@
import { BaseEmailHtml, Info } from "../components";
export interface Feedback {
userId: number;
username: string;
email: string;
rating: string;
comment: string;
}
@@ -9,7 +10,8 @@ export interface Feedback {
export const FeedbackEmail = (props: Feedback & Partial<React.ComponentProps<typeof BaseEmailHtml>>) => {
return (
<BaseEmailHtml subject="Feedback" title="Feedback">
<Info label="User id" description={props.userId} withSpacer />
<Info label="Username" description={props.username} withSpacer />
<Info label="Email" description={props.email} withSpacer />
<Info label="Rating" description={props.rating} withSpacer />
<Info label="Comment" description={props.comment} withSpacer />
</BaseEmailHtml>
+4 -3
View File
@@ -1,9 +1,9 @@
import { renderEmail } from "../";
import BaseEmail from "./_base-email";
export interface Feedback {
userId: number;
username: string;
email: string;
rating: string;
comment: string;
}
@@ -28,7 +28,8 @@ export default class FeedbackEmail extends BaseEmail {
protected getTextBody(): string {
return `
User id: ${this.feedback.userId}
User: ${this.feedback.username}
Email: ${this.feedback.email}
Rating: ${this.feedback.rating}
Comment: ${this.feedback.comment}
`;