ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.92k stars 1.1k forks source link

Predefined mail merge source #2604

Closed str closed 6 months ago

str commented 9 months ago

This issue is unique.

Your idea.

We have an online HR system that can export contacts to use in the mail merge "From URL" option.

image

Is it possible to pass a variable to OnlyOffice to have preset option? something like

Thank you.

XDmitryK commented 9 months ago

@str Hi I don't quite understand what you mean. Do you want a certain variable with a file recipients to always be loaded when creating a new document?

str commented 9 months ago

When you click the mail-merge button, it shows you 2 options

We would like the system to have a 3rd option that says 'From company HR system', and when the user selects it, the editor would automatically load the recipients and all other mail-merge fields from a spreadsheet in a specific URL.

We also noticed that the system only allows you to load 100 records, so adding multiple "From HR page 1", "From HR page 2", etc, would be an option to load more than 100 records.

We are loading the editor via new DocsAPI.DocEditor('editor', config); It would be great if we could pass a flag to the config variable, where we can append that 3rd option to the mail-merge dropdown. Something similar to:

config.editorConfig.mailMegeSources = [
    {'label': 'From HR system,   1...100', 'https://hr.system/contacts?limit=100&page=1'},
    {'label': 'From HR system, 101...200', 'https://hr.system/contacts?limit=100&page=2'},
    {'label': 'From HR system, 201...300', 'https://hr.system/contacts?limit=100&page=3'}
];
// generate JWT with new mailMegeSources
// and then pass the config to the editor
var docEditor = new DocsAPI.DocEditor('editor', config);

Would something like that be possible?

We are planning on building a plugin if this is not possible.

XDmitryK commented 6 months ago

@str

  1. In your case, this method may help you. https://api.onlyoffice.com/editors/config/events#onRequestSelectSpreadsheet
  2. In the case of a number of 100 recipients, it was designed this way. I will clarify whether it is possible to expand the number of recipients.
str commented 6 months ago

We ended creating our own plugin.