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