**Describe the bug**
When using BPMN Script Task to send an email, variables are not being passed to the applied email template. (Email is sent correctly but variables are not passed to the email template)
**To Reproduce**
Steps to reproduce the behavior:
1. Create a BPMN and use Script Task (define some variables) - create email and apply email template and execute send email to the target entity, code below:
2. Check email received, see attached screenshot
**Expected behavior**
When sending email using a Script Task via BPMN, if an email template is applied to the email we would like to have variables passed to the email template.
**EspoCRM version**
Espocrm version 7.0.8
Advanced pack version 2.8.9
When using BPMN Script Task to send an email, variables are not being passed to the applied email template. (Email is sent correctly but variables are not passed to the email template)
**To Reproduce**
Steps to reproduce the behavior:
1. Create a BPMN and use Script Task (define some variables) - create email and apply email template and execute send email to the target entity, code below:
Code:
// define variables $period = datetime\today(); $firstContact = "Lynda Doe"; $secondContact = "James Doe"; // create email $emailId = record\create( 'Email', 'to', entity\attribute('emailAddress'), 'isHtml', true, 'status', 'Sending', 'parentId', id, 'parentType', 'Account' ); // apply existing template ext\email\applyTemplate($emailId, '61a7fddee0219119e'); //send email ext\email\send($emailId);
**Expected behavior**
When sending email using a Script Task via BPMN, if an email template is applied to the email we would like to have variables passed to the email template.
**EspoCRM version**
Espocrm version 7.0.8
Advanced pack version 2.8.9
Comment