Hi I need some help, I have this chunk of code on my Formulas Entity. It sending two emails to "$mailAddress," . I must send only one. what am I doing wrong?
Regards!
Regards!
Code:
$contactId = array\at(contacts1Ids, 0);
$mailAddress = record\attribute('Contact', $contactId, 'customEmail');
$contactName = record\attribute('Contact', $contactId, 'name');
debugMail = $mailAddress;
ifThen(($mailAddress!='' && $mailAddress!=null),[INDENT]$id = record\create(
'Email', //Email
'from', 'mail@mydomain.com',
'to', $mailAddress,
'status', 'sending',
'subject', 'testing mail',
'body', string\concatenate($mailAddress,'-',$contactName,'-'),
'isHtml', false
);[/INDENT]
);
ext\email\send($id);

Comment