Announcement

Collapse
No announcement yet.

Formula send two emails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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);

  • #2
    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)
    Rabii
    Web Dev | Freelancer

    Comment


    • #3
      Hi tinchux,

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

      Comment

      Working...
      X