Skip to main content

Text Messaging System

Mobile Device Required

๐Ÿšจ CRITICAL: SMS functionality only works on actual mobile devices. Desktop and browser-based SMS is not supported.

๐Ÿ“ฑ Complete SMS messaging system with merge field templates that works on any Salesforce object through proper Custom Settings configuration.

๐ŸŽฏ Quick Startโ€‹

Quick Setup Checklist

โœ… Step 1: Configure Custom Settings for your target objects
โœ… Step 2: Add textMerge LWC to page layouts
โœ… Step 3: Create text templates with merge fields
โœ… Step 4: Test on mobile device


๐Ÿ“‹ Table of Contentsโ€‹


๐Ÿ“Š Overviewโ€‹

The Text Messaging System provides SMS functionality with dynamic merge fields for any Salesforce object. Built around the textMerge Lightning Web Component (LWC), this system allows you to send personalized text messages directly from Salesforce records using your mobile device.

โœจ Key Capabilitiesโ€‹

  • Universal SMS: Works with any Salesforce object (Contact, Caring Case, custom objects)
  • Dynamic Templates: Merge field templates with object-specific data
  • Mobile Optimized: Interface designed for mobile devices
  • Real-time Preview: See resolved merge fields before sending

โš™๏ธ Technical Requirementsโ€‹

System Prerequisites

Before setting up SMS functionality, ensure these requirements are met:

๐Ÿ“ฑ Mobile Device Requirementโ€‹

Critical Limitation

SMS functionality is strictly limited to mobile devices. The following platforms do NOT support SMS:

  • Desktop browsers (Chrome, Firefox, Safari, Edge)
  • Laptop browsers
  • Tablet browsers in desktop mode

๐Ÿ”ง System Requirementsโ€‹

RequirementDetailsStatus
Lightning ExperienceMust be enabledโœ… Required
Mobile DeviceiOS or Android with SMS capabilityโœ… Required
Custom SettingsPastoral Care Custom Settings configuredโœ… Required
LWC ComponenttextMerge added to page layoutsโœ… Required
Phone FieldsTarget objects have phone field configurationโœ… Required

๐Ÿ“ฆ Supported Objectsโ€‹

Ready to Use:

  • Contact - Standard SMS fields configured
  • Caring_Case__c - Relationship field SMS supported

๐Ÿ”ง Prerequisites Setupโ€‹

Setup Overview

Three main configuration steps are required before SMS functionality becomes available.

Step 1: ๐Ÿ“‹ Configure Custom Settingsโ€‹

The system uses Pastoral Care Custom Settings (List Custom Setting) to define SMS-enabled objects and available phone fields.

๐Ÿ” Detailed Custom Settings Configuration

Navigation Path:

Setup โ†’ Custom Settings โ†’ Pastoral Care Custom Settings โ†’ Manage

Configuration Steps:

  1. Click "New" to create a new custom setting record
  2. Fill in the required fields according to the table below
  3. Save the configuration
  4. Test the setup on a mobile device

๐Ÿ“Š Configuration Fieldsโ€‹

Field NamePurposeExample ValuesRequired
NameUnique identifier for this configurationContact_SMS_Configโœ… Yes
Object API NamesTarget Salesforce object for SMSContact, Caring_Case__c, Accountโœ… Yes
Phone Field API NamesAvailable phone fields for merge templatesPhone,MobilePhone,HomePhoneโœ… Yes
Naming Convention

Use descriptive names that include the object type: Contact_SMS_Config, Account_SMS_Config, etc.

Step 2: ๐ŸŽจ Add textMerge LWC to Page Layoutsโ€‹

Component Requirement

The textMerge Lightning Web Component must be added to every object's page layout where SMS functionality is needed.

For Contact, Account, etc.:

  1. Go to Object Manager โ†’ [Object Name] โ†’ Lightning Record Pages
  2. Edit the appropriate record page
  3. Drag the textMerge component to desired location
  4. Configure component properties if needed
  5. Save and Activate the page

Step 3: โ˜Ž๏ธ Verify Phone Field Configurationโ€‹

๐Ÿ“ž Phone Field Requirements by Object

Standard Phone Fieldsโ€‹

Contact Object:

  • Phone - Primary business phone
  • MobilePhone - Mobile/cell phone
  • HomePhone - Personal home phone
  • OtherPhone - Additional phone number

Account Object:

  • Phone - Primary organization phone

Custom Phone Fieldsโ€‹

If standard fields aren't sufficient:

  1. Create custom phone fields on your objects
  2. Add field API names to Custom Settings configuration
  3. Update page layouts to include the new fields
  4. Test merge field availability in templates

๐ŸŒ SMS Configuration for Any Objectโ€‹

Universal Setup

Configure SMS functionality for any Salesforce object in three simple steps.

๐Ÿš€ Quick Configuration Processโ€‹

Create Object Configuration:

// Example Custom Setting Record
Name: "Student_SMS_Config"
Object API Names: "Student__c"
Phone Field API Names: "Phone__c,Emergency_Phone__c"

๐Ÿ“Š Multi-Object Configuration Examplesโ€‹

Organization Use Cases

Different organization types can configure SMS for their specific objects:

ObjectCustom Setting NamePhone Fields
ContactContact_SMSPhone,MobilePhone,HomePhone
Caring_Case__cCaringCase_SMSContact__r.Phone,Contact__r.MobilePhone
Member__cMember_SMSPrimary_Phone__c,Secondary_Phone__c

๐Ÿ“ Creating Text Templatesโ€‹

๐ŸŽจ Using Text Template Builderโ€‹

Template Creation

Access the template builder through the Pastoral Care app to create merge field templates.

Navigation:

  1. Open Pastoral Care app
  2. Click "Text Templates" tab
  3. Click "New" to create template

๐Ÿ”ง Merge Field Syntaxโ€‹

Merge Field Format

Use Salesforce merge field syntax: {!Object.Field} for dynamic data insertion.

๐Ÿ“ Complete Merge Field Examples

Contact Object Merge Fieldsโ€‹

// Basic Contact Information
{!Contact.FirstName} - First name
{!Contact.LastName} - Last name
{!Contact.Name} - Full name
{!Contact.Phone} - Primary phone
{!Contact.MobilePhone} - Mobile phone
{!Contact.Email} - Email address
{!Contact.MailingStreet} - Mailing address
{!Contact.MailingCity} - City
{!Contact.MailingState} - State
{!Contact.MailingPostalCode} - ZIP code

Caring Case Object Merge Fieldsโ€‹

// Case Information
{!Caring_Case__c.Name} - Case identifier
{!Caring_Case__c.Status__c} - Current status
{!Caring_Case__c.Case_Type__c} - Type of case
{!Caring_Case__c.Priority__c} - Priority level

// Related Contact Information
{!Caring_Case__c.Contact__r.FirstName} - Contact first name
{!Caring_Case__c.Contact__r.LastName} - Contact last name
{!Caring_Case__c.Contact__r.Phone} - Contact phone

// Staff Information
{!Caring_Case__c.Assigned_Staff__c} - Assigned staff member
{!Caring_Case__c.Point_of_Contact__c} - Family contact person

Universal System Fieldsโ€‹

// User Information
{!$User.FirstName} - Current user first name
{!$User.LastName} - Current user last name
{!$User.Name} - Current user full name
{!$User.Email} - Current user email

// Organization Information
{!$Organization.Name} - Organization name
{!$Organization.Phone} - Organization phone

// Date/Time Information
{!TODAY()} - Current date
{!NOW()} - Current date and time

๐Ÿ“ฑ Sample Templateโ€‹

Professional Template Example

Here's a well-structured template example for caring case updates:

Hello {!Contact.FirstName},

Your caring case "{!Caring_Case__c.Name}" has been updated.

๐Ÿ“‹ Case Details:
โ€ข Status: {!Caring_Case__c.Status__c}
โ€ข Type: {!Caring_Case__c.Case_Type__c}
โ€ข Assigned Staff: {!Caring_Case__c.Assigned_Staff__c}

Questions? Reply to this message or call us.

Best regards,
{!$User.FirstName}
{!$Organization.Name}

๐Ÿ“ฑ Using SMS on Mobile Devicesโ€‹

Mobile Only

Remember: SMS functionality is exclusively available on mobile devices. Desktop users cannot send SMS messages.

๐Ÿ“ฒ Mobile SMS Workflowโ€‹

Open Salesforce Mobile:

  1. Launch Salesforce mobile app
  2. Navigate to the target record
  3. Locate the textMerge component

โœ… Message Validation Featuresโ€‹

FeatureDescriptionBenefit
Template FilteringOnly shows templates for current objectPrevents confusion
Merge Field ResolutionShows actual data in previewEnsures accuracy
Phone ValidationFilters invalid/empty numbersReduces errors
Character CountDisplays message lengthPrevents SMS truncation
Preview ModeShows final content before sendingFinal validation

๐Ÿ” Troubleshootingโ€‹

Quick Diagnostics

Most SMS issues fall into these categories. Check each section systematically.

๐Ÿ“ฑ SMS Not Workingโ€‹

๐Ÿšจ Issue: SMS functionality completely unavailable

Diagnostic Checklist:

โœ… Device Check: Using actual mobile device (not desktop/browser)
โœ… Component Check: textMerge LWC added to page layout
โœ… Settings Check: Custom Settings configured for object
โœ… Data Check: Phone fields exist and contain valid data
โœ… Permission Check: User has access to SMS components

Resolution Steps:

  1. Verify mobile device requirement first
  2. Check page layout includes textMerge component
  3. Validate Custom Settings configuration
  4. Test with known good phone numbers

๐Ÿ”ง Component Issuesโ€‹

โš ๏ธ Issue: textMerge component not appearing

Common Causes & Solutions:

CauseSolutionValidation
Component not on page layoutAdd textMerge to Lightning record pageCheck page builder
Page not assigned to profileAssign page to user's profile/appTest with different user
Component permissionsVerify Lightning component accessCheck permission sets
Cache issuesClear browser cache, re-loginTest in incognito mode

๐Ÿ”— Merge Field Problemsโ€‹

๐Ÿ“ Issue: Phone fields not appearing in templates

Configuration Validation:

  1. Custom Settings Check:

    • Phone Field API Names syntax: Phone,MobilePhone,HomePhone
    • No spaces after commas
    • Exact field API name matches
  2. Field Access Check:

    • Fields exist on target object
    • User profile has field access
    • Field-level security permits read access
  3. Relationship Fields:

    • Use dot notation: Contact__r.Phone
    • Verify relationship exists
    • Check relationship field access

๐ŸŽฏ Custom Object SMS Problemsโ€‹

๐Ÿ› ๏ธ Issue: SMS not working on custom objects

Step-by-Step Resolution:

  1. Custom Settings Validation:

    // Verify these fields are populated correctly:
    Name: "MyObject_SMS_Config"
    Object API Names: "My_Custom_Object__c"
    Phone Field API Names: "Phone__c,Mobile_Phone__c"
  2. Component Integration:

    • textMerge LWC added to custom object's record page
    • Page activated and assigned to profiles
    • Component visible in Lightning Experience
  3. Field Configuration:

    • Phone fields exist on custom object
    • Fields are accessible to users
    • Field API names match Custom Settings exactly

๐Ÿ’ก Best Practicesโ€‹

๐Ÿ”ง Configuration Managementโ€‹

Professional Setup

Follow these best practices for maintainable SMS configuration:

Consistent Naming:

// Custom Settings Names
Contact_SMS_Config
Account_SMS_Config
Student_SMS_Config
Patient_SMS_Config

// Template Names
Contact_Welcome_Template
Case_Update_Template
Appointment_Reminder_Template

๐Ÿ”’ Security & Privacyโ€‹

๐Ÿ›ก๏ธ Security Best Practices

Data Access Controlsโ€‹

  • Field-Level Security: Limit merge field access to necessary data
  • Object Permissions: Ensure appropriate object access levels
  • Phone Field Visibility: Review who can see phone number fields
  • Template Access: Control who can create and modify templates

Mobile Securityโ€‹

  • Device Security: Encourage device passcodes and biometric locks
  • Session Management: Implement appropriate session timeouts
  • SMS Monitoring: Track SMS usage patterns for anomalies
  • Data Loss Prevention: Monitor for sensitive data in SMS content

Privacy Complianceโ€‹

  • Consent Management: Ensure SMS consent is properly documented
  • Data Retention: Establish SMS data retention policies
  • Audit Trails: Maintain logs of SMS communications
  • Opt-out Procedures: Provide clear SMS opt-out mechanisms

๐Ÿ“ˆ Performance Optimizationโ€‹

โšก Performance Best Practices

Template Efficiencyโ€‹

  • Merge Field Limits: Limit complex merge field usage
  • Template Length: Keep templates concise for SMS limits
  • Rendering Speed: Test template resolution performance
  • Character Optimization: Monitor character counts and SMS costs

System Performanceโ€‹

  • Custom Settings Efficiency: Minimize number of configuration records
  • Bulk Operations: Plan for bulk SMS scenarios
  • Cache Management: Understand template caching behavior
  • Error Handling: Implement graceful error recovery

๐Ÿ“– Related Documentation:


๐Ÿงช Interactive Example: Template Builderโ€‹

Try modifying this template in real-time to see how merge fields work:

Live Editor
function TemplateBuilder() {
  const [template, setTemplate] = React.useState(`Hello {firstName},

Your caring case "{caseName}" has been updated.

๐Ÿ“‹ Status: {status}
๐Ÿ‘ค Assigned Staff: {staff}

Questions? Reply to this message.

Best regards,
{organizationName}`);

  const [sampleData, setSampleData] = React.useState({
    firstName: 'Sarah',
    caseName: 'Bereavement Support - Smith Family',
    status: 'In Progress',
    staff: 'Rabbi Johnson',
    organizationName: 'Temple Beth Shalom'
  });

  const previewText = template
    .replace('{firstName}', sampleData.firstName)
    .replace('{caseName}', sampleData.caseName)
    .replace('{status}', sampleData.status)
    .replace('{staff}', sampleData.staff)
    .replace('{organizationName}', sampleData.organizationName);

  return (
    <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem', padding: '1rem', border: '1px solid #ccc', borderRadius: '8px' }}>
      <div>
        <h4>๐Ÿ“ Template Editor</h4>
        <textarea 
          value={template}
          onChange={(e) => setTemplate(e.target.value)}
          style={{ width: '100%', height: '200px', fontFamily: 'monospace', fontSize: '12px' }}
        />
      </div>
      <div>
        <h4>๐Ÿ“ฑ SMS Preview</h4>
        <div style={{ 
          background: '#f5f5f5', 
          padding: '1rem', 
          borderRadius: '8px', 
          fontFamily: 'system-ui', 
          fontSize: '14px',
          whiteSpace: 'pre-line',
          height: '200px',
          overflow: 'auto'
        }}>
          {previewText}
        </div>
      </div>
    </div>
  );
}
Result
Loading...
Live Code Features
  • Real-time editing: Modify the template on the left
  • Instant preview: See SMS output on the right
  • Sample data: Pre-filled with realistic values
  • Learning tool: Experiment with merge field patterns