<div class="col">
<app-input-text i18n-title title="Name" formControlName="name" [error]="error?.name"></app-input-text>
<app-input-text i18n-title title="IMAP Server" formControlName="imap_server" [error]="error?.imap_server"></app-input-text>
- <app-input-text i18n-title title="IMAP Port" formControlName="imap_server" [error]="error?.imap_port"></app-input-text>
+ <app-input-text i18n-title title="IMAP Port" formControlName="imap_port" [error]="error?.imap_port"></app-input-text>
<app-input-select i18n-title title="IMAP Security" [items]="imapSecurityOptions" formControlName="imap_security"></app-input-select>
</div>
<div class="col">
<div class="row">
<div class="col">
<app-input-text i18n-title title="Name" formControlName="name" [error]="error?.name"></app-input-text>
- <app-input-text i18n-title title="Order" formControlName="order" [error]="error?.order"></app-input-text>
<app-input-select i18n-title title="Account" [items]="accounts" formControlName="account"></app-input-select>
<app-input-text i18n-title title="Folder" formControlName="folder" i18n-hint hint="Subfolders must be separated by a delimiter, often a dot ('.') or slash ('/'), but it varies by mail server." [error]="error?.folder"></app-input-text>
<app-input-number i18n-title title="Maximum age (days)" formControlName="maximum_age" [showAdd]="false" [error]="error?.maximum_age"></app-input-number>
getForm(): FormGroup {
return new FormGroup({
name: new FormControl(null),
- order: new FormControl(null),
account: new FormControl(null),
folder: new FormControl('INBOX'),
filter_from: new FormControl(null),
<ng-container *ngIf="mailAccounts && mailRules">
<h4>
<ng-container i18n>Mail accounts</ng-container>
- <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailAccount()" i18n>Add Account</button>
+ <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailAccount()">
+ <svg class="sidebaricon me-1" fill="currentColor">
+ <use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
+ </svg>
+ <ng-container i18n>Add Account</ng-container>
+ </button>
</h4>
<ul class="list-group" formGroupName="mailAccounts">
<h4 class="mt-4">
<ng-container i18n>Mail rules</ng-container>
- <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailRule()" i18n>Add Rule</button>
+ <button type="button" class="btn btn-sm btn-primary ms-4" (click)="editMailRule()">
+ <svg class="sidebaricon me-1" fill="currentColor">
+ <use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
+ </svg>
+ <ng-container i18n>Add Rule</ng-container>
+ </button>
</h4>
<ul class="list-group" formGroupName="mailRules">
for (let rule of this.mailRules) {
storeData.mailRules[rule.id.toString()] = {
name: rule.name,
- order: rule.order,
account: rule.account,
folder: rule.folder,
filter_from: rule.filter_from,
rule.id.toString(),
new FormGroup({
name: new FormControl(null),
- order: new FormControl(null),
account: new FormControl(null),
folder: new FormControl(null),
filter_from: new FormControl(null),
this.toastService.showInfo(
$localize`Saved account "${newMailAccount.name}".`
)
+ this.mailAccountService.clearCache()
this.mailAccountService.listAll().subscribe((r) => {
this.mailAccounts = r.results
this.initialize()
this.toastService.showInfo(
$localize`Saved rule "${newMailRule.name}".`
)
+ this.mailRuleService.clearCache()
this.mailRuleService.listAll().subscribe((r) => {
this.mailRules = r.results
export interface PaperlessMailRule extends ObjectWithId {
name: string
- order: number
-
account: number // PaperlessMailAccount.id
folder: string
assign_correspondent = CorrespondentField(allow_null=True, required=False)
assign_tags = TagsField(many=True, allow_null=True, required=False)
assign_document_type = DocumentTypeField(allow_null=True, required=False)
+ order = serializers.IntegerField(required=False)
class Meta:
model = MailRule