Text Messaging System
๐จ 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โ
โ
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
- โ๏ธ Technical Requirements
- ๐ง Prerequisites Setup
- ๐ SMS Configuration for Any Object
- ๐ Creating Text Templates
- ๐ฑ Using SMS on Mobile Devices
- ๐ Troubleshooting
- ๐ก Best Practices
๐ 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โ
- ๐ฑ Messaging Features
- โ๏ธ Configuration
- ๐ง Administration
- 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
- Custom Settings: Universal configuration through Pastoral Care Custom Settings
- LWC Integration: textMerge component for any page layout
- Template Builder: Built-in template creation with validation
- Multi-Object Support: Configure SMS for standard and custom objects
- Field Mapping: Configure phone field API names for any object
- Template Management: Create and organize text templates
- Permission Control: Role-based access to SMS functionality
- Validation: Automatic merge field and phone number validation
โ๏ธ Technical Requirementsโ
Before setting up SMS functionality, ensure these requirements are met:
๐ฑ Mobile Device Requirementโ
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โ
| Requirement | Details | Status |
|---|---|---|
| Lightning Experience | Must be enabled | โ Required |
| Mobile Device | iOS or Android with SMS capability | โ Required |
| Custom Settings | Pastoral Care Custom Settings configured | โ Required |
| LWC Component | textMerge added to page layouts | โ Required |
| Phone Fields | Target objects have phone field configuration | โ Required |
๐ฆ Supported Objectsโ
- โ Pre-configured
- ๐ง Configurable
Ready to Use:
- Contact - Standard SMS fields configured
- Caring_Case__c - Relationship field SMS supported
Requires Setup:
- Account - Add Custom Settings configuration
- Custom Objects - Configure object API names and phone fields
- Standard Objects - Any object with phone fields can be configured
๐ง Prerequisites Setupโ
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:
- Click "New" to create a new custom setting record
- Fill in the required fields according to the table below
- Save the configuration
- Test the setup on a mobile device
๐ Configuration Fieldsโ
| Field Name | Purpose | Example Values | Required |
|---|---|---|---|
| Name | Unique identifier for this configuration | Contact_SMS_Config | โ Yes |
| Object API Names | Target Salesforce object for SMS | Contact, Caring_Case__c, Account | โ Yes |
| Phone Field API Names | Available phone fields for merge templates | Phone,MobilePhone,HomePhone | โ Yes |
Use descriptive names that include the object type: Contact_SMS_Config, Account_SMS_Config, etc.
Step 2: ๐จ Add textMerge LWC to Page Layoutsโ
The textMerge Lightning Web Component must be added to every object's page layout where SMS functionality is needed.
- ๐ Standard Objects
- ๐ง Custom Objects
For Contact, Account, etc.:
- Go to Object Manager โ [Object Name] โ Lightning Record Pages
- Edit the appropriate record page
- Drag the textMerge component to desired location
- Configure component properties if needed
- Save and Activate the page
For Custom Objects:
- Navigate to Object Manager โ [Custom Object] โ Lightning Record Pages
- Edit or create a Lightning record page
- Add the textMerge component from the component palette
- Position it in an appropriate section
- Save, Activate, and assign to profiles
Step 3: โ๏ธ Verify Phone Field Configurationโ
๐ Phone Field Requirements by Object
Standard Phone Fieldsโ
Contact Object:
Phone- Primary business phoneMobilePhone- Mobile/cell phoneHomePhone- Personal home phoneOtherPhone- Additional phone number
Account Object:
Phone- Primary organization phone
Custom Phone Fieldsโ
If standard fields aren't sufficient:
- Create custom phone fields on your objects
- Add field API names to Custom Settings configuration
- Update page layouts to include the new fields
- Test merge field availability in templates
๐ SMS Configuration for Any Objectโ
Configure SMS functionality for any Salesforce object in three simple steps.
๐ Quick Configuration Processโ
- 1๏ธโฃ Custom Settings
- 2๏ธโฃ Add Component
- 3๏ธโฃ Test Setup
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"
Add textMerge LWC:
- Edit Lightning record page for your object
- Drag textMerge component to page
- Save and activate
Verification Steps:
- Open record on mobile device
- Verify textMerge component appears
- Check phone field availability
- Test template functionality
๐ Multi-Object Configuration Examplesโ
Different organization types can configure SMS for their specific objects:
- โช Religious Organizations
- ๐ Educational Institutions
- ๐ฅ Healthcare Organizations
| Object | Custom Setting Name | Phone Fields |
|---|---|---|
| Contact | Contact_SMS | Phone,MobilePhone,HomePhone |
| Caring_Case__c | CaringCase_SMS | Contact__r.Phone,Contact__r.MobilePhone |
| Member__c | Member_SMS | Primary_Phone__c,Secondary_Phone__c |
| Object | Custom Setting Name | Phone Fields |
|---|---|---|
| Contact | Contact_SMS | Phone,MobilePhone |
| Student__c | Student_SMS | Phone__c,Emergency_Phone__c |
| Guardian__c | Guardian_SMS | Primary_Phone__c,Work_Phone__c |
| Object | Custom Setting Name | Phone Fields |
|---|---|---|
| Contact | Contact_SMS | Phone,MobilePhone |
| Patient__c | Patient_SMS | Primary_Phone__c,Emergency_Contact_Phone__c |
| Provider__c | Provider_SMS | Direct_Phone__c,Office_Phone__c |
๐ Creating Text Templatesโ
๐จ Using Text Template Builderโ
Access the template builder through the Pastoral Care app to create merge field templates.
- 1๏ธโฃ Access Builder
- 2๏ธโฃ Configure Template
- 3๏ธโฃ Test Template
Navigation:
- Open Pastoral Care app
- Click "Text Templates" tab
- Click "New" to create template
Required Fields:
- Template Name: Descriptive identifier
- Template Body: Message content with merge fields
- Object Type: Target Salesforce object
Validation Steps:
- Preview merge field resolution
- Test with sample data
- Verify character count
- Check mobile display
๐ง Merge Field Syntaxโ
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โ
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โ
Remember: SMS functionality is exclusively available on mobile devices. Desktop users cannot send SMS messages.
๐ฒ Mobile SMS Workflowโ
- 1๏ธโฃ Access Record
- 2๏ธโฃ Select Phone
- 3๏ธโฃ Choose Template
- 4๏ธโฃ Send Message
Open Salesforce Mobile:
- Launch Salesforce mobile app
- Navigate to the target record
- Locate the textMerge component
Choose Phone Number:
- Component displays available phone numbers
- Numbers auto-populate from configured fields
- Invalid/empty numbers are filtered out
- Relationship fields are supported
Select Text Template:
- Browse available templates
- Templates filtered by object type
- Preview shows merge field resolution
- Character count is displayed
Final Review & Send:
- Review resolved message content
- Verify phone number accuracy
- Check character count
- Tap Send to deliver SMS
โ Message Validation Featuresโ
| Feature | Description | Benefit |
|---|---|---|
| Template Filtering | Only shows templates for current object | Prevents confusion |
| Merge Field Resolution | Shows actual data in preview | Ensures accuracy |
| Phone Validation | Filters invalid/empty numbers | Reduces errors |
| Character Count | Displays message length | Prevents SMS truncation |
| Preview Mode | Shows final content before sending | Final validation |
๐ Troubleshootingโ
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:
- Verify mobile device requirement first
- Check page layout includes textMerge component
- Validate Custom Settings configuration
- Test with known good phone numbers
๐ง Component Issuesโ
โ ๏ธ Issue: textMerge component not appearing
Common Causes & Solutions:
| Cause | Solution | Validation |
|---|---|---|
| Component not on page layout | Add textMerge to Lightning record page | Check page builder |
| Page not assigned to profile | Assign page to user's profile/app | Test with different user |
| Component permissions | Verify Lightning component access | Check permission sets |
| Cache issues | Clear browser cache, re-login | Test in incognito mode |
๐ Merge Field Problemsโ
๐ Issue: Phone fields not appearing in templates
Configuration Validation:
-
Custom Settings Check:
- Phone Field API Names syntax:
Phone,MobilePhone,HomePhone - No spaces after commas
- Exact field API name matches
- Phone Field API Names syntax:
-
Field Access Check:
- Fields exist on target object
- User profile has field access
- Field-level security permits read access
-
Relationship Fields:
- Use dot notation:
Contact__r.Phone - Verify relationship exists
- Check relationship field access
- Use dot notation:
๐ฏ Custom Object SMS Problemsโ
๐ ๏ธ Issue: SMS not working on custom objects
Step-by-Step Resolution:
-
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" -
Component Integration:
- textMerge LWC added to custom object's record page
- Page activated and assigned to profiles
- Component visible in Lightning Experience
-
Field Configuration:
- Phone fields exist on custom object
- Fields are accessible to users
- Field API names match Custom Settings exactly
๐ก Best Practicesโ
๐ง Configuration Managementโ
Follow these best practices for maintainable SMS configuration:
- ๐ Naming Standards
- ๐ Documentation
- ๐งช Testing Strategy
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
Configuration Documentation:
- Document phone field mappings
- Maintain template usage guidelines
- Record Custom Settings purposes
- Track object configuration changes
Systematic Testing:
- Test each Custom Settings configuration
- Validate all phone field mappings
- Verify template merge field resolution
- Test on actual mobile devices
๐ 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:
- ๐ง Email Communications - Automated email notification system
- โ๏ธ Settings & Configuration - Centralized settings management
- ๐ Caring Cases Management - Case management workflows
- ๐ NPSP Integration - Engagement plan automation
๐งช Interactive Example: Template Builderโ
Try modifying this template in real-time to see how merge fields work:
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> ); }
- 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