ioBroker / ioBroker.javascript

Script engine for JavaScript and Blockly
MIT License
322 stars 120 forks source link

Blockly email block with dynamic amount of attachments #1522

Closed Diginix closed 4 months ago

Diginix commented 4 months ago

The current email block supports only 2 attachments. I have scripts where I need 3 up to 6 attachments in one mail. As workaround I use a javascript function block with

sendTo("email", {
   to: to,
   subject: subject,
   text: text,
   attachments: [
     {path: att1},
     {path: att2},
     {path: att3},
     {path: att4},
     {path: att5},
     {path: att6},
   ]
});

But I wasn't able to implement conditions in this to have only 3 or 4 attachment keys with path if 5 and 6 is false or empty. The best way would be to have the standard email block enhanced for dynamic amount of attachments.

klein0r commented 4 months ago

The email-Block is created by the email adapter: https://github.com/iobroker-community-adapters/ioBroker.email

https://github.com/iobroker-community-adapters/ioBroker.email/blob/master/admin/blockly.js

Diginix commented 4 months ago

Ah I see, 2019 I've created a feature request in email adapter. As it seems no one else needs this. https://github.com/iobroker-community-adapters/ioBroker.email/issues/11

klein0r commented 4 months ago

As it seems no one else needs this.

The problem is, that more experienced users (and developers) use JavaScript instead of Blockly and are not interested in improving Blocks