Skip to content

Commit

Permalink
update general email reply to's
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack MB committed Aug 13, 2024
1 parent d4d368b commit c16cc09
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions components/submission/showSubmissionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const validationSchema = [
.shape({
name: Yup.string().required("Please add an artist name"),
image: Yup.object().required("Please add an artist image"),
email: Yup.string()
.required("Please add an email")
.email("Invalid email"),
})
),
}),
Expand Down Expand Up @@ -125,6 +128,7 @@ export default function ShowSubmissionForm({
{
name: "",
pronouns: "",
email: "",
bio: "",
image: "",
},
Expand Down
6 changes: 6 additions & 0 deletions components/submission/showSubmissionStep3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ export default function ShowSubmissionStep3({
type="text"
label="Pronouns"
/>
<InputField
name={`extraArtists.${index}.email`}
type="email"
label="Email"
required
/>
<TextareaField
name={`extraArtists.${index}.bio`}
rows={4}
Expand Down
8 changes: 2 additions & 6 deletions lib/resend/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ export async function sendEmail(artist, show, severity) {
from: "Refuge Worldwide <[email protected]>",
to: artist.email,
subject: subject(severity),
reply_to: [
"[email protected]",
"[email protected]",
"[email protected]",
],
reply_to: ["[email protected]", "[email protected]"],
react: ShowSubmissionEmail({
userName: artist.name,
showDateStart: show.date,
Expand Down Expand Up @@ -53,7 +49,6 @@ export async function sendConfirmationEmail(show) {
reply_to: [
"[email protected]",
"[email protected]",
"[email protected]",
],
react: ShowSubmissionEmail({
userName: artist.label,
Expand Down Expand Up @@ -94,6 +89,7 @@ export async function sendArtworkEmail(artist, date) {
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
],
react: ShowArtworkEmail({
userName: artist.name,
Expand Down
3 changes: 3 additions & 0 deletions pages/api/show-submission-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ const addArtist = async (artist) => {
pronouns: {
"en-US": artist.pronouns,
},
email: {
"en-US": [artist.email],
},
role: {
"en-US": false,
},
Expand Down
1 change: 1 addition & 0 deletions types/shared.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export type SubmissionFormValues = {
extraArtists?: Array<{
name: string;
pronouns: string;
email: string;
bio?: string;
image?: string;
}>;
Expand Down
8 changes: 4 additions & 4 deletions util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ export const formatArtistNames = (data: ArtistInterface[]) => {
const names = data.map(({ name }) => name);

if (names.length === 1) {
return `With ${names[0]}`;
return `with ${names[0]}`;
}

if (names.length === 2) {
return `With ${names[0]} and ${names[1]}`;
return `with ${names[0]} and ${names[1]}`;
}

if (names.length === 3) {
return `With ${names.slice(0, 2).join(", ")} and ${names[3]}`;
return `with ${names.slice(0, 2).join(", ")} and ${names[3]}`;
}

return `With ${names.slice(0, 2).join(", ")} and others`;
return `with ${names.slice(0, 2).join(", ")} and others`;
};

export const getMixcloudKey = (url: string) =>
Expand Down

0 comments on commit c16cc09

Please sign in to comment.