Sorry my mistake, it is possible to send email to multiple emails at once, for example sending an email to multiple contacts of a Case entity, you can loops through the contacts get their email addresses and then send the email using the formula function like below:
PHP Code:
$i = 0;
$emails = list();
while($i < array\length(contactsIds),
(
$emails = array\push(
$emails,
record\attribute('Contact', array\at(contactsIds, $i), 'emailAddress')
);
$i = $i + 1;
)
);
$emailId = record\create(
'Email',
'toEmailAddresses', $emails,
'bcc', 'me@example.com',
'status', 'Sending',
'body', 'Body of your email',
'isHtml', true,
'parentId', entity\attribute('id'),
'parentType', 'Case'
);
ext\email\send($emailId);
Hope this helps
Leave a comment: