Formula send two emails

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Vadym
    replied
    Hi tinchux,

    Please describe in more detail what logic you are trying to achieve?

    Leave a comment:


  • rabii
    replied
    I think it is it do with with formula of your entity (seems the formula is triggered twice hence why the email is sent twice), check out the whole code of your formula. Also there is an issue with
    Code:
     ifThen(($mailAddress!='' && $mailAddress!=null)
    i think you should only stick with
    Code:
    ifThen(($mailAddress != null)

    Leave a comment:


  • tinchux
    started a topic Formula send two emails

    Formula send two emails

    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!

    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);
Working...