Unfilled 'to' field if sent via record\create and ext\email\send

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • iioi
    Member
    • Jun 2022
    • 48

    Unfilled 'to' field if sent via record\create and ext\email\send

    $id = record\create(
    'Email',
    'from', 'XXX@XXX.com',
    'to', 'YY@yy.com',
    'subject', name,
    'body', conent1,
    'isHtml', true,
    'status', 'Sending'
    );

    ext\email\send($id);​​​

    creates email with empty 'to' field (in attach). It seems to be a bug.

    I can fill this fiels with:

    $idarrd = record\findOne('EmailAddress','','', 'name',$toemail);
    ifThen($idarrd == '',
    $idarrd = record\create(
    'EmailAddress',
    'name', $toemail,
    'lower', $toemail
    );
    );
    record\relate('Email', $id,'toEmailAddresses', $idarrd);​
  • lazovic
    Super Moderator
    • Jan 2022
    • 809

    #2
    Hi iioi,

    Please tell me which version of EspoCRM are you using?

    Comment

    • iioi
      Member
      • Jun 2022
      • 48

      #3
      7.1.7

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 727

        #4

        Hi iioi ,

        I can't reproduce this issue on version 7.1.7. Everything works as it should. Field "to" is filled with the email address that we specified in the formula.
        You may have some customizations in your EspoCRM files that affect the filling of the Email entity attributes.​

        Comment

        • iioi
          Member
          • Jun 2022
          • 48

          #5
          Do you have YY@yy.com record in EmailAddress when ext\email\send($id) ​ ?
          Last edited by iioi; 09-30-2022, 02:19 PM.

          Comment


          • victor
            victor commented
            Editing a comment
            I tested a variant of the first formula several times. Field "to" is filled with the email address that we specified in the formula.
        Working...