Skip to content

Options configurable in Topol Options

Topol options are used to set features which topol provides.

ts
export default interface IPluginOptions {
  authorize: {
    apiKey: string;
    userId: string | number;
  };
  api?: IAPI;
  apiAuthorizationHeader?: IAuthHeaderConfig | string;
  apiBlocks?: Record<string, IAPIBlockProperties>;
  autosaveInterval?: number;
  betaFeatures?: {
    carousel?: boolean;
  };
  chatAI?: boolean;
  colors?: Array<string>;
  contentBlocks?: IContentBlockOptions[];
  currentUser?: IUser;
  customBlocks?: CustomBlockData[];
  customFileManager?: boolean;
  customFonts?: {
    override?: boolean;
    fonts: Array<IFont>;
  };
  defaultTemplateSettings?: {
    emailWidth?: number;
    emailBackgroundColor?: string;
    blockBackgroundColor?: string;
    buttonsBackgroundColor?: string;
    hyperlinkColor?: string;
    h1?: {
      [key in TopolTagAttribute]?: string;
    };
    h2?: {
      [key in TopolTagAttribute]?: string;
    };
    h3?: {
      [key in TopolTagAttribute]?: string;
    };
    p?: {
      [key in TopolTagAttribute]?: string;
    };
    button?: {
      [key in TopolTagAttribute]?: string;
    };
    "line-height"?: number;
    "structure-margin"?: string;
  };
  disableAiAssistant?: boolean;
  disableAlerts?: boolean;
  disableExtendedComparators?: boolean;
  emailServiceProvider?: "mailchimp" | "sparkpost";
  enableAutosaves?: boolean;
  enableComments?: boolean;
  enableImageToTextRatio?: boolean;
  enableMergeTagPreview?: boolean;
  enableSectionVariants?: boolean;
  fontSizes?: Array<number>;
  googleApiKey?: string;
  helpdesk?: IHelpdesk;
  hideSettingsTab?: boolean;
  htmlMinified?: boolean;
  imageCompressionOptions?: {
    qualityJpeg?: number;
    qualityPng?: number;
    enableAutoResize?: boolean;
    enableCompression?: boolean;
  };
  imageEditor?: boolean;
  imageMaxSize?: number;
  language?: string;
  light?: boolean;
  logicalOperatorsInsideVariant?: boolean;
  mainMenuAlign?: "left" | "right";
  mergeTags?: Array<IMergeTagGroup | IMergeTag>;
  mobileFirstEnabled?: boolean;
  premadeBlocks?: Object | boolean;
  premadeTemplates?: boolean;
  role?: "manager" | "editor" | "reader";
  savedBlocks?: Array<ISavedBlock> | boolean;
  showUnsavedDialogBeforeExit?: boolean;
  smartMergeTags?: {
    enabled: boolean;
    patterns?: Record<string, SmartMergeTagPattern>;
    syntax?: {
      start: string;
      end: string;
    };
  };
  teamUsers?: IUser[];
  templateId?: number | string;
  testingEmails: boolean | string[];
  theme?: ITheme;
  tinyConfig?: unknown;
  title?: string;
  topBarOptions?: Array<string>;
  renameTemplate?: boolean;
  removeTopBar?: boolean;
  windowBar?: Array<string>;
  callbacks: {
    onSave?(json: JSON, html: HTMLDocument): void;
    onSaveAndClose?(json: JSON, html: HTMLDocument): void;
    onTestSend?(email: string | string[], json: JSON, html: HTMLDocument): void;
    onOpenFileManager?(): void;
    onLoaded?(): void;
    onBlockSave?(block: ISavedBlock): void;
    onBlockRemove?(blockId: Number): void;
    onBlockEdit?(blockId: Number): void;
    onInit?(): void;
    onUndoChange?(count: Number): void;
    onRedoChange?(count: Number): void;
    onPreview?(html: HTMLDocument): void;
    onAlert?(notification: INotification): void;
    onClose?(): void;
    onEdittedWithoutSaveChanged?(hasUnsavedChanges: boolean): void;
    onOpenCustomBlockDialog?(customBLock: unknown): void;
    onTemplateRename?(title: string): void;
    updateTestingEmailAddresses?(emails: array[]): void;
    onError?(type: string, message: string): void;
  };
}