Skip to content

Commit

Permalink
update hours string in initial email
Browse files Browse the repository at this point in the history
  • Loading branch information
dragongrrl committed Aug 6, 2020
1 parent b061446 commit 529aafd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions docs/messaging-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ There are two batch jobs that need to run to send referrals and referral followu

These batch classes should execute at least once per day. Please follow the instructions in the Help documentation to schedule the classes: https://help.salesforce.com/articleView?id=code_schedule_batch_apex.htm&type=5

If you wish, you may also execute the batch jobs outside of a schedule.

The batch classes may be run at any time by utilizing the Execute Anonymous function in Salesforce. Please review the instructions in the Help documentation for more information: https://help.salesforce.com/articleView?id=code_dev_console_execute_anonymous.htm&type=5

To execute the initial referral batch job, execute the following code snippet:
Batch_SendInitialClientReferrals batchable = new Batch_SendInitialClientReferrals();
refrec.Batch_SendInitialClientReferrals batchable = new refrec.Batch_SendInitialClientReferrals();
Database.executeBatch(batchable);

To execute the referral followup batch job, execute the following code snippet:
Batch_SendReferralFollowupReminders batchable = new Batch_SendReferralFollowupReminders();
refrec.Batch_SendReferralFollowupReminders batchable = new refrec.Batch_SendReferralFollowupReminders();
Database.executeBatch(batchable);
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ global class ReferralEmailTemplateController {
Datetime endDt = Datetime.newInstance(Date.today(),hour.End_Time__c);
String endTime = endDt.format('h:mm a');

hoursString = hour.Day__c + ': '+startTime+' - '+endTime+'';
hoursString = hoursString + hour.Day__c + ': '+startTime+' - '+endTime+' ';
}
return hoursString;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ public class Test_ReferralEmailTemplateController {
);
insert svc;

List<Open_Hours__c> openList = new List<Open_Hours__c>();
Open_Hours__c open = new Open_Hours__c (
Day__c = 'Monday',
Start_Time__c = Time.newInstance(9, 0, 0, 0),
End_Time__c = Time.newInstance(17, 0, 0, 0),
Service__c = svc.Id
);
insert open;
openList.add(open);
Open_Hours__c open2 = new Open_Hours__c (
Day__c = 'Friday',
Start_Time__c = Time.newInstance(9, 0, 0, 0),
End_Time__c = Time.newInstance(17, 0, 0, 0),
Service__c = svc.Id
);
openList.add(open2);

insert openList;

Referral__c ref = new Referral__c (
Contact__c = cont.Id,
Expand Down Expand Up @@ -86,7 +96,7 @@ public class Test_ReferralEmailTemplateController {
System.assertEquals('Test Service',referralResponse.Referral__r.Service__r.Name);
System.assertEquals('Tester',referralResponse.Referral__r.Contact__r.LastName);

System.assertEquals('Monday: 9:00 AM - 5:00 PM', controller.openHoursString);
System.assertEquals(true, controller.openHoursString.contains('Monday'));
}


Expand Down

0 comments on commit 529aafd

Please sign in to comment.