Twilio

Prev Next

The Twilio integration provides the ability to scale the sending of emails when requesting Carrier quotes and performing other TMS actions. This integration provides additional email sends when routinely reaching the Salesforce cap. 

Setup

Enter Credentials

Enable the Twilio integration by completing the following steps.

  1. Navigate to TMS Admin.

  2. Select Credentials

  3. Select the Global Services tab.

  4. Find Twilio in the list and open the card. 

  5. Check the Enabled box.

  6. Enter the User ID into the text field. This is the single verified email address from Twilio.

  7. Click the Save button when finished.

Valid credentials are required from a Twilio subscription. See examples in the table below.

User ID

Password 1

Password 2

Customer Number

Email Address

API Key generated on the Twilio portal.

If Domain Authentication setup was completed, the User ID is "Revenova" instead of the email address.

Remote Site Settings

Upgrading from previous versions of the TMS may have outdated information. Check that the Remote Site Settings for the Twilio integration URL are up to date.

  1. Click the Setup gear icon in the top right corner.

  2. From the drop-down, click Setup.

  3. In the Quick Find Toolbar type Remote Site Settings and click the link.

  4. From the list of remote sites find Twilio and click the Edit link.

  5.  Update the Remote Site URL to match the Service URL below.

Service URL: https://api.sendgrid.com

Test Service URL: https://api.sendgrid.com

The Twilio integration requires a file extension for all attached documents. Uploading files into the TMS with any Revenova components maintains the file extension. Uploading documents with Salesforce components removes the file extension. Salesforce components for uploading documents are described here.

Org-Wide Email Addresses

The logic controlling the Twilio integration when Org-Wide Email Addresses are enabled works as follows.

  • Confirm permissions are configured properly to send org-wide emails with the Twilio integration.

    • Org-Wide Email Addresses must have the Allow All Profiles to Use this From Address option selected to send messages with Twilio.

  • Before sending email messages with Twilio, the User must have access to the User lookup field on the Load or Trip Plan objects.

    • The assigned OWEA is used instead of the User lookup when the User does not have the lookup permission.

    • If no OWEA is assigned, no error is generated and no email is sent.

  • The User ID field on the Twilio credentials card is used.

    • If the User ID field is not a valid email address, the sender’s name and email address is used instead.

The Document Options Email Template type settings control the logic for each email type sent by Twilio.

  • The Twilio User ID from the credentials card is displayed in the From email address.

  • The Reply-To email address follows the Document Options settings.

    • The Reply-To email is the Reply To email address, when populated.

    • If no Reply To email address is set, the Reply To User lookup is used when populated.

    • If no Reply To email and Reply To User fields are set, the Org-Wide Email Address is used.

  • The Sender Display Name follows the same logic as the Reply-To email address.

    • If the Reply-To email populated, the display name is the current user’s name.

    • If no Reply To email address is set, the Reply To User lookup is used for when populated.

      • The display name is the User’s name.

    • If no Reply To email and Reply To User fields are set, the Org-Wide Email Address display name is used.

Integration Call

The Twilio integration is called when one of the four actions below are completed in the TMS. Twilio returns either a success message or an error payload containing information describing why the request failed.

Mail Send

Four TMS actions call the Twilio integration for email send.

TMS Operation

Twilio Endpoint

Request Type

Response

Email Send

Mail Send

POST

200: OK

Sample Mail Send Request Payload

{
  "personalizations": [
    {
      "to": [
        {
          "email": "email@test.com"
        }
      ]
    }
  ],
  "from": {
    "email": "support@revenova.com",
    "name": "Org Wide Email"
  },
  "reply_to": {
    "email": "test@revenova.com"
  },
  "subject": "Quote Request for Load L-12",
  "content": [
    {
      "type": "text/html",
      "value": "<table class=\"ql-table-blob\" id=\"contentpage_emailTemplateBodyContent\" style=\"background-color: #FAFAFA;\" width=\"100%\">\n \n <tbody><tr><td align=\"center\" width=\"100%\"><table cellspacing=\"0\" cellpadding=\"0\" width=\"600\" role=\"presentation\" style=\"background-color: #FFFFFF;\" class=\"contentRoot\">\n \n <tbody><tr><td style=\"padding-top: 10px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px;\"><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" role=\"presentation\" style=\"align-items: flex-start; width: 100%; background-color:#00121F;\" class=\"contentbuilderBaseColumnRow\">\n \n <tbody><tr valign=\"top\"><td style=\"vertical-align: top;display: inline-block; float:left\" class=\"columnCell\" width=\"100%\"><table style=\"width: 100%; border-collapse: collapse; word-break:break-word;\" cellspacing=\"0\" cellpadding=\"0\">\n \n <tbody><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width:100%; border-collapse: collapse; word-break:break-word;\">\n \n <tbody><tr><td align=\"Center\" style=\"padding-top: 25px;padding-bottom: 25px;\"><img width=\"420\" alt=\"\" src=\"https://flow-drive-4523-dev-ed.scratch.file.force.com/file-asset-public/rtms__RevenovaTMS_Logo_reverse?oid=00DOv00000JbkqX\" style=\"width: 100%; display: block; border: none; max-width: 70%; object-fit: fill;\"></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" role=\"presentation\" style=\"align-items: flex-start; width: 100%; background-color:;\" class=\"contentbuilderBaseColumnRow\">\n \n <tbody><tr valign=\"top\"><td style=\"vertical-align: top;display: inline-block; float:left\" class=\"columnCell\" width=\"100%\"><table style=\"width: 100%; border-collapse: collapse; word-break:break-word;\" cellspacing=\"0\" cellpadding=\"0\">\n \n <tbody><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><div style=\"text-align: center;\"><span style=\"font-size:22px;\">Request for Load Quote<br><strong>L-12</strong></span></div></td></tr>\n \n </tbody></table></td></tr><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><span style=\"font-size:16px;\">If you would like to price this load, please click <strong>Submit Quote.&nbsp;</strong></span></td></tr>\n \n </tbody></table></td></tr><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><span style=\"font-size:20px;\">Load Information</span></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" role=\"presentation\" style=\"align-items: flex-start; width: 100%; background-color:;\" class=\"contentbuilderBaseColumnRow\">\n \n <tbody><tr valign=\"top\"><td style=\"vertical-align: top;display: inline-block; float:left\" class=\"columnCell\" width=\"50%\"><div style=\"margin-right: 5px;margin-bottom: 5px;\" class=\"columnDiv\"><table style=\"width: 100%; border-collapse: collapse; word-break:break-word;\" cellspacing=\"0\" cellpadding=\"0\">\n \n <tbody><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><span style=\"font-size:16px;\">Pickup Date<br><strong>7/18/2025</strong><br><br> Distance<br><strong>1,017.695 miles</strong><br><br> Mode<br><strong>Truckload</strong></span></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></div></td><td style=\"vertical-align: top;display: inline-block; float:left\" class=\"columnCell\" width=\"50%\"><div style=\"margin-right: 5px;margin-bottom: 5px;\" class=\"columnDiv\"><table style=\"width: 100%; border-collapse: collapse; word-break:break-word;\" cellspacing=\"0\" cellpadding=\"0\">\n \n <tbody><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><span style=\"font-size:16px;\">Delivery Date<br><strong>7/22/2025</strong><br><br> Total Stops<br><strong>2</strong><br><br> Total Weight<br><strong>15,750&nbsp;lbs</strong></span></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></div></td></tr>\n \n </tbody></table><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" role=\"presentation\" style=\"align-items: flex-start; width: 100%; background-color:;\" class=\"contentbuilderBaseColumnRow\">\n \n <tbody><tr valign=\"top\"><td style=\"vertical-align: top;display: inline-block; float:left\" class=\"columnCell\" width=\"100%\"><table style=\"width: 100%; border-collapse: collapse; word-break:break-word;\" cellspacing=\"0\" cellpadding=\"0\">\n \n <tbody><tr><td><table style=\"border: 0; width: 100%; border-collapse: collapse; mso-table-lspace:0pt;mso-table-rspace:0pt;\">\n \n <tbody><tr><td style=\"padding-top: 10px;padding-bottom: 10px;mso-table-lspace:0pt;mso-table-rspace:0pt;\"><div style=\"word-break:break-word; border: 0; mso-border-alt: 0; text-align:center;\"><div style=\"display: inline-block; border: 0; mso-border-alt: 0; width:40%;\"><a href=\"https://flow-drive-4523-dev-ed.scratch.my.site.com/email/s/carrierguest?h=998852220&amp;l=a1zOv000003sjo2IAA&amp;a=rfq&amp;c=003Ov000016qcYj\" style=\"direction:ltr;display:block;text-align:center;margin:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; padding-top: 10px;padding-right: 20px;padding-bottom: 10px;padding-left: 20px; color:#ffffff;font-weight:normal;font-style:normal;text-decoration:none;border:0;background-color:#007dd2;border-radius:4px;mso-padding-alt:0;\"><span>Submit Quote</span></a></div></div></td></tr>\n \n </tbody></table></td></tr><tr><td><table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" id=\"contentRegion\" style=\"width: 100%; border-collapse: collapse; word-break: break-word; font-size: 14px\">\n \n <tbody><tr><td style=\"font-family: Arial, Helvetica, sans-serif;padding-top: 15px;padding-right: 15px;padding-bottom: 15px;padding-left: 15px;\"><span style=\"font-size: 16px;\">Thank you,&nbsp;<br><br> User User<br> test@revenova.com<br> Scratch2-SC-US-tmsMain/packages/tmsMain-PaulMathewson-NAMESPACE</span><br> &nbsp;</td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table></td></tr>\n \n </tbody></table><p><br></p>"
    }
  ]
}

No Payload returns when successful.

Sample error Mail Send Response Payload

{
  "errors": [
    {
      "message": "The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements",
      "field": "from",
      "help": null
    }
  ]
}

No TMS Field Updates

Email Exceptions

The Twilio integration is not used when sending the following email types from the TMS. Performing the actions below sends a single email via Salesforce functionality.

  • Removing a Carrier from a Load.

  • Emails sent due to Customer Invoice generation.

  • Sending Load documents to a user (themselves) in the Customer Portal.

  • Driver Confirmation email sent from the Trip Planner.

  • Tracking requests sent to a Carrier Service with an Email Status method. Batch Status request emails follow the same rules.

  • Bulk Tendering to Carriers from the Load List View.

  • When removing a Carrier from a Load with the Truckstop event processor.

  • When a Load is Tendered via the Quote Wizard in the Customer Portal.

  • When the Tender action is completed in the Carrier Email Loop.

Error:

Orgs that do not use the Twilio integration may experience issues sending emails. An example is Carriers not receiving Load Tender emails from the Email Loop. Confirm the Enabled field is NOT Checked on the Twilio credentials card.