feat(campaign-ui): configure attachment delivery behavior
This commit is contained in:
@@ -22,15 +22,21 @@ export function ensureCampaignDraft(version: CampaignVersionDetail | null): Reco
|
||||
raw.server = isRecord(raw.server) ? raw.server : {};
|
||||
raw.recipients = isRecord(raw.recipients) ? raw.recipients : {};
|
||||
raw.template = isRecord(raw.template) ? raw.template : { subject: "", text: "" };
|
||||
const sourceAttachments = asRecord(raw.attachments);
|
||||
raw.attachments = {
|
||||
base_path: ".",
|
||||
allow_individual: false,
|
||||
send_without_attachments: true,
|
||||
send_without_attachments_behavior: "continue",
|
||||
global: [],
|
||||
missing_behavior: "ask",
|
||||
ambiguous_behavior: "ask",
|
||||
...asRecord(raw.attachments)
|
||||
...sourceAttachments
|
||||
};
|
||||
const normalizedAttachments = asRecord(raw.attachments);
|
||||
if (sourceAttachments.send_without_attachments_behavior === undefined) {
|
||||
normalizedAttachments.send_without_attachments_behavior = getBool(normalizedAttachments, "send_without_attachments", true) ? "continue" : "block";
|
||||
}
|
||||
raw.entries = isRecord(raw.entries) ? raw.entries : { inline: [] };
|
||||
raw.validation_policy = {
|
||||
unsent_attachment_files: "warn",
|
||||
|
||||
Reference in New Issue
Block a user