Action

Call

Posted by dchar, Last update over 6 years ago

Steps

  • script

    // scan draft for phone numbers
    // define tag for use in prompt if found.
    
    var re = /(\([0-9]{3}\)|[0-9]{3})[ -]?[0-9]{3}[ -]?[0-9]{4}/g;
    var p1 = draft.content.match(re) || [];
    
    var re2 = /[0-9]{3}\.[0-9]{3}\.[0-9]{4}/g;
    var p2 = draft.content.match(re2) || [];
    
    var phoneNumbers = p1.concat(p2);
    
    if (!phoneNumbers || phoneNumbers.length == 0) {
      alert("No phone numbers found.");
      context.cancel();
    }
    else {
       draft.setTemplateTag('phone_numbers', phoneNumbers.join("|"));
    }
  • prompt

    promptKey
    prompt
    promptTitle
    Select phone number
    promptMessage
    promptButtons
    [[phone_numbers]]
    includeTextField
    false
    textFieldDefault
    includeCancelButton
    true
  • url

    template
    tel://[[prompt_button]]
    useSafari
    false
    encodeTags
    true

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.