SMS Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Poohart
    Junior Member
    • Dec 2025
    • 1

    #1

    SMS Issue

    Hi,

    This is probably a very simple problem, but somehow it doesn't work...

    It's about sending SMS out of a workflow. I set this up with my provider Sms77 and it works wonderfully.

    I use the following script in the workflow, which Espo specifies as follows:
    Code:
    ---
    
    $body = 'Hi! This is an SMS notification from EspoCRM.';
    
    // Phone number is obtained from the entity.
    $phoneNumber = phoneNumber;
    
    $smsId = record\create(
    'text',
    'to', $phoneNumber,
    'body', $body
    );
    
    ext\sms\send($smsId);
    
    ---
    However, I would now like the variable $body not to be fixed text, but to send me 2 fields from the entity separated by a space.

    I thought I'd take care of that
    $body = fieldname1 + ' ' + fieldmane 2;

    but that doesn't work.

    How can I affect $body accordingly?​
  • lazovic
    Super Moderator
    • Jan 2022
    • 1210

    #2
    Hi Poohart,

    Please use the string\concatenate() function: https://docs.espocrm.com/administrat...ingconcatenate.

    Example:
    Code:
    $body = string\concatenate(fieldname1, ' ', fieldname2);

    Comment

    Working...