Blockly.Blocks['Import_Email'] = { init: function() { this.setNextStatement(true); this.setPreviousStatement(true); this.setInputsInline(false); // generate the runtime variables to use when the emails are read from the server if(this.workspace) { let varsToCreate = [ { varName: 'emailReadId', key: 'varId' }, { varName: 'emailReadSubject', key: 'varSubject' }, { varName: 'emailReadBody', key: 'varBody' }, { varName: 'emailReadFromAddress', key: 'varFromAddress' }, { varName: 'emailReadToAddresses', key: 'varToAddresses' }, { varName: 'emailReadCCAddresses', key: 'varCCAddresses' }, { varName: 'emailReadBCCAddresses', key: 'varBCCAddresses' } ]; if(this.workspace.getVariable) { varsToCreate.forEach(function(varToCreate){ let varName = varToCreate.varName; let key = varToCreate.key; if(!this.workspace.getVariable(varName)) { this[key] = this.workspace.createVariable(varName); } }.bind(this)); } else { var variableList = this.workspace.variableList || []; varsToCreate.forEach(function(varToCreate){ let varName = varToCreate.varName; let key = varToCreate.key; if(variableList.indexOf(varName) === -1) { this[key] = this.workspace.createVariable(varName); } }.bind(this)); } } // configure the block inputs this.appendDummyInput() .appendField('Read Email'); this.setTooltip('Reads HTML-enabled emails from specified server using entered credentials.'); this.setColour(Blockly.Msg.INTEGRATIONS_HUE ? Blockly.Msg.INTEGRATIONS_HUE : Blockly.Blocks.integrations.HUE); this.appendInputs(); }, appendInputs: function() { this.appendDummyInput() .appendField('Read From') .setAlign(Blockly.ALIGN_RIGHT) .appendField(new Blockly.FieldDropdown([['Outlook365', 'outlook365'], ['Exchange', 'exchange']]), 'serverType'); this.appendValueInput('host') .appendField('Host') .setAlign(Blockly.ALIGN_RIGHT); this.appendValueInput('username') .appendField('Username') .setAlign(Blockly.ALIGN_RIGHT); this.appendValueInput('password') .appendField('Password') .setAlign(Blockly.ALIGN_RIGHT); this.appendValueInput('dateRangeStart') .appendField('Date Start') .setAlign(Blockly.ALIGN_RIGHT); this.appendValueInput('dateRangeEnd') .appendField('Date End') .setAlign(Blockly.ALIGN_RIGHT); this.appendValueInput('mailbox') .appendField('Mailbox') .setAlign(Blockly.ALIGN_RIGHT); this.appendDummyInput('BEFORE_BLOCK_LABEL') .appendField('For Each Email Read, do'); this.appendStatementInput('emailActions'); }};Uncaught TypeError: Cannot read property 'connectionDBList' of null at Blockly.RenderedConnection.Blockly.Connection (blockly_compressed.js:1015) at new Blockly.RenderedConnection (blockly_compressed.js:1047) at Blockly.BlockSvg.makeConnection_ (blockly_compressed.js:1461) at Blockly.BlockSvg.Blockly.Block.appendInput_ (blockly_compressed.js:1404) at Blockly.BlockSvg.appendInput_ (blockly_compressed.js:1460) at Blockly.BlockSvg.Blockly.Block.appendValueInput (blockly_compressed.js:1396) at Blockly.BlockSvg.appendInputs (citdev-blocks.js:6268) at Blockly.BlockSvg.init (citdev-blocks.js:6261) at Blockly.BlockSvg.Blockly.Block (blockly_compressed.js:1369) at new Blockly.BlockSvg (blockly_compressed.js:1425)/**
* Class for a connection between blocks.
* @param {!Blockly.Block} source The block establishing this connection.
* @param {number} type The type of the connection.
* @constructor
*/
Blockly.Connection = function(source, type) {
/**
* @type {!Blockly.Block}
* @protected
*/
this.sourceBlock_ = source;
/** @type {number} */
this.type = type;
// Shortcut for the databases for this connection's workspace.
if (source.workspace.connectionDBList) { // <------------ Error is here
this.db_ = source.workspace.connectionDBList[type];
this.dbOpposite_ =
source.workspace.connectionDBList[Blockly.OPPOSITE_TYPE[type]];
this.hidden_ = !this.db_;
}
};
varsToCreate.forEach(function(varToCreate){
let varName = varToCreate.varName;
let key = varToCreate.key;
this[key] = Blockly.Variables.getOrCreateVariablePackage(this.workspace, null, varName, '');
}.bind(this));