saving
, fetching
, and management
, you can use the following callbacks for saving, fetching, and manage library.mailui.init({
saveToLibrary: {
enabled: true,
},
});
done(data[], meta: object)
function.mailui.registerProvider(
"library:collections",
async (params: { page: number; perPage: number }, done: Function) => {
done(data, meta);
}
);
Property | Description | Type | Default |
---|---|---|---|
page | The current page number | number | 1 |
perPage | The number of items displayed per page | number | 20 |
Property | Description | Type | Default |
---|---|---|---|
id | Unique number | any | - |
name | Library specific name | string | - |
thumbnailUrl | Thumbnail full url | string | - |
elementType | The element type should be one of the following | SECTION ROW COLUMN ELEMENT | - |
Property | Description | Type | Default |
---|---|---|---|
page | The current page number | number | 1 |
lastPage | The total number of pages | number | - |
perPage | The number of items displayed per page | number | 20 |
total | The total number of items | number | - |
mailui.registerProvider("library:collectionData",
async (params, done) => {
const data = {}; // template JSON
done(data);
}
);
Property | Description | Type | Default |
---|---|---|---|
id | Unique number | any | - |
name | Library specific name | string | - |
thumbnailUrl | Thumbnail full url | string | - |
elementType | The element type should be one of the following | SECTION ROW COLUMN ELEMENT | - |
mailui.registerProvider("library:saved", async (params, done) => {
try {
// Run your save library code here
const library = {};
done(library);
} catch (error) {
done(null)
console.log("An error has occurred during save data.");
}
}
);
Property | Description | Type | Default |
---|---|---|---|
thumbnail | Uploaded BLOB file type | file | - |
name | Library specific name | string | - |
data | JSON data | object | - |
elementType | The element type should be one of the following | SECTION ROW COLUMN ELEMENT | - |
Property | Description | Type | Default |
---|---|---|---|
id | Unique number | any | - |
name | Library specific name | string | - |
thumbnailUrl | Thumbnail full url | string | - |
elementType | The element type should be one of the following | SECTION ROW COLUMN ELEMENT | - |
mailui.registerCallback("library:removed", async (params, done) => {
done();
});
Property | Description | Type | Default |
---|---|---|---|
id | Unique number | any | - |
name | Library specific name | string | - |
thumbnailUrl | Thumbnail full url | string | - |
elementType | The element type should be one of the following | SECTION ROW COLUMN ELEMENT | - |