fix: ability to clear reply-to and from name from templates and campaigns
This commit is contained in:
@@ -22,8 +22,8 @@ export interface CreateCampaignData {
|
|||||||
subject: string;
|
subject: string;
|
||||||
body: string;
|
body: string;
|
||||||
from: string;
|
from: string;
|
||||||
fromName?: string;
|
fromName?: string | null;
|
||||||
replyTo?: string;
|
replyTo?: string | null;
|
||||||
audienceType: CampaignAudienceType;
|
audienceType: CampaignAudienceType;
|
||||||
audienceCondition?: FilterCondition;
|
audienceCondition?: FilterCondition;
|
||||||
segmentId?: string;
|
segmentId?: string;
|
||||||
@@ -35,8 +35,8 @@ export interface UpdateCampaignData {
|
|||||||
subject?: string;
|
subject?: string;
|
||||||
body?: string;
|
body?: string;
|
||||||
from?: string;
|
from?: string;
|
||||||
fromName?: string;
|
fromName?: string | null;
|
||||||
replyTo?: string;
|
replyTo?: string | null;
|
||||||
audienceType?: CampaignAudienceType;
|
audienceType?: CampaignAudienceType;
|
||||||
audienceCondition?: FilterCondition;
|
audienceCondition?: FilterCondition;
|
||||||
segmentId?: string;
|
segmentId?: string;
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ export class TemplateService {
|
|||||||
subject: string;
|
subject: string;
|
||||||
body: string;
|
body: string;
|
||||||
from: string;
|
from: string;
|
||||||
fromName?: string;
|
fromName?: string | null;
|
||||||
replyTo?: string;
|
replyTo?: string | null;
|
||||||
type?: Template['type'];
|
type?: Template['type'];
|
||||||
},
|
},
|
||||||
): Promise<Template> {
|
): Promise<Template> {
|
||||||
@@ -120,8 +120,8 @@ export class TemplateService {
|
|||||||
subject?: string;
|
subject?: string;
|
||||||
body?: string;
|
body?: string;
|
||||||
from?: string;
|
from?: string;
|
||||||
fromName?: string;
|
fromName?: string | null;
|
||||||
replyTo?: string;
|
replyTo?: string | null;
|
||||||
type?: Template['type'];
|
type?: Template['type'];
|
||||||
},
|
},
|
||||||
): Promise<Template> {
|
): Promise<Template> {
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ export function buildEmailFieldsUpdate(data: {
|
|||||||
subject?: string;
|
subject?: string;
|
||||||
body?: string;
|
body?: string;
|
||||||
from?: string;
|
from?: string;
|
||||||
fromName?: string;
|
fromName?: string | null;
|
||||||
replyTo?: string;
|
replyTo?: string | null;
|
||||||
}): Prisma.CampaignUpdateInput | Prisma.TemplateUpdateInput {
|
}): Prisma.CampaignUpdateInput | Prisma.TemplateUpdateInput {
|
||||||
return buildUpdateData(data) as Prisma.CampaignUpdateInput | Prisma.TemplateUpdateInput;
|
return buildUpdateData(data) as Prisma.CampaignUpdateInput | Prisma.TemplateUpdateInput;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,8 +213,8 @@ export default function CampaignDetailsPage() {
|
|||||||
subject: editedCampaign.subject,
|
subject: editedCampaign.subject,
|
||||||
body: editedCampaign.body,
|
body: editedCampaign.body,
|
||||||
from: editedCampaign.from,
|
from: editedCampaign.from,
|
||||||
fromName: editedCampaign.fromName || undefined,
|
fromName: editedCampaign.fromName || null,
|
||||||
replyTo: editedCampaign.replyTo || undefined,
|
replyTo: editedCampaign.replyTo || null,
|
||||||
audienceType: editedCampaign.audienceType,
|
audienceType: editedCampaign.audienceType,
|
||||||
segmentId: editedCampaign.segmentId || undefined,
|
segmentId: editedCampaign.segmentId || undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ export default function CreateCampaignPage() {
|
|||||||
subject,
|
subject,
|
||||||
body,
|
body,
|
||||||
from,
|
from,
|
||||||
fromName: fromName || undefined,
|
fromName: fromName || null,
|
||||||
replyTo: replyTo || undefined,
|
replyTo: replyTo || null,
|
||||||
audienceType,
|
audienceType,
|
||||||
segmentId: audienceType === CampaignAudienceType.SEGMENT ? segmentId : undefined,
|
segmentId: audienceType === CampaignAudienceType.SEGMENT ? segmentId : undefined,
|
||||||
audienceFilter: audienceType === CampaignAudienceType.FILTERED ? [] : undefined,
|
audienceFilter: audienceType === CampaignAudienceType.FILTERED ? [] : undefined,
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ export default function TemplateEditorPage() {
|
|||||||
subject: editedTemplate.subject,
|
subject: editedTemplate.subject,
|
||||||
body: editedTemplate.body,
|
body: editedTemplate.body,
|
||||||
from: editedTemplate.from,
|
from: editedTemplate.from,
|
||||||
fromName: editedTemplate.fromName || undefined,
|
fromName: editedTemplate.fromName || null,
|
||||||
replyTo: editedTemplate.replyTo || undefined,
|
replyTo: editedTemplate.replyTo || null,
|
||||||
type: editedTemplate.type,
|
type: editedTemplate.type,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ export default function CreateTemplatePage() {
|
|||||||
subject,
|
subject,
|
||||||
body,
|
body,
|
||||||
from,
|
from,
|
||||||
fromName: fromName || undefined,
|
fromName: fromName || null,
|
||||||
replyTo: replyTo || undefined,
|
replyTo: replyTo || null,
|
||||||
type,
|
type,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ export const TemplateSchemas = {
|
|||||||
subject: z.string().min(1),
|
subject: z.string().min(1),
|
||||||
body: z.string().min(1),
|
body: z.string().min(1),
|
||||||
from: email,
|
from: email,
|
||||||
fromName: z.string().max(100).optional(),
|
fromName: z.string().max(100).nullish(),
|
||||||
replyTo: email.optional(),
|
replyTo: email.nullish(),
|
||||||
type: z.nativeEnum(TemplateType).default('MARKETING'),
|
type: z.nativeEnum(TemplateType).default('MARKETING'),
|
||||||
}),
|
}),
|
||||||
update: z.object({
|
update: z.object({
|
||||||
@@ -152,8 +152,8 @@ export const TemplateSchemas = {
|
|||||||
subject: z.string().min(1).optional(),
|
subject: z.string().min(1).optional(),
|
||||||
body: z.string().min(1).optional(),
|
body: z.string().min(1).optional(),
|
||||||
from: email.optional(),
|
from: email.optional(),
|
||||||
fromName: z.string().max(100).optional(),
|
fromName: z.string().max(100).nullish(),
|
||||||
replyTo: email.optional(),
|
replyTo: email.nullish(),
|
||||||
type: z.nativeEnum(TemplateType).optional(),
|
type: z.nativeEnum(TemplateType).optional(),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
@@ -282,8 +282,8 @@ export const CampaignSchemas = {
|
|||||||
subject: z.string().min(1),
|
subject: z.string().min(1),
|
||||||
body: z.string().min(1),
|
body: z.string().min(1),
|
||||||
from: email,
|
from: email,
|
||||||
fromName: z.string().max(100).optional(),
|
fromName: z.string().max(100).nullish(),
|
||||||
replyTo: email.optional(),
|
replyTo: email.nullish(),
|
||||||
audienceType: z.nativeEnum(CampaignAudienceType),
|
audienceType: z.nativeEnum(CampaignAudienceType),
|
||||||
audienceCondition: filterConditionSchema.optional(),
|
audienceCondition: filterConditionSchema.optional(),
|
||||||
segmentId: uuid.optional(),
|
segmentId: uuid.optional(),
|
||||||
@@ -297,8 +297,8 @@ export const CampaignSchemas = {
|
|||||||
subject: z.string().optional(),
|
subject: z.string().optional(),
|
||||||
body: z.string().optional(),
|
body: z.string().optional(),
|
||||||
from: z.string().optional(),
|
from: z.string().optional(),
|
||||||
fromName: z.string().max(100).optional(),
|
fromName: z.string().max(100).nullish(),
|
||||||
replyTo: z.string().optional(),
|
replyTo: z.string().nullish(),
|
||||||
audienceType: z.nativeEnum(CampaignAudienceType).optional(),
|
audienceType: z.nativeEnum(CampaignAudienceType).optional(),
|
||||||
audienceCondition: filterConditionSchema.optional(),
|
audienceCondition: filterConditionSchema.optional(),
|
||||||
segmentId: z.string().optional(),
|
segmentId: z.string().optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user