-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding email templates, reports, and dashboards
- Loading branch information
Showing
18 changed files
with
1,021 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,9 +396,13 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
insert term; | ||
if(parent.MobilePhone != null && parent.MobilePhone != '' ){ | ||
String SMSmessage = Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name; | ||
if(parent.Email != null && parent.Email != ''){ | ||
SMSmessage = SMSmessage + Label.C501_RegSite_SMSweSentAnEmail + ' ' + parent.Email; | ||
} | ||
C501_UTIL_ClassRegUtilities.logActivityToContact(parent.Id,SMSmessage, SMSmessage,'Call'); | ||
C501_UTIL_ClassRegUtilities.sendSMSGenericFuture(parent.MobilePhone,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name ); | ||
} | ||
|
||
if(parent.Email != null && parent.Email != '' ){ | ||
String teacherName = ''; | ||
for(Integer i = 0; i < schoolNameText.npe5__Affiliations__r.size(); i++){ | ||
|
@@ -415,10 +419,13 @@ public class C501_CTRL_ClassReg_CreateAcct { | |
nextStartDate = Datetime.newInstance(schoolNameText.C501_Next_Program_Start_Date__c, Time.newInstance(0,0,0,0)).format('MMMMM d, yyyy'); | ||
} | ||
|
||
String emailMessage = Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name +Label.C501_RegSite_EmailConfirmP2+' '+nextStartDate+' '+Label.C501_RegSite_EmailConfirmP3+' '+teacherName+Label.C501_RegSite_EmailConfirmP4; | ||
C501_UTIL_ClassRegUtilities.SendEmailGeneric('[email protected]',parent.Email,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name,emailMessage); | ||
Id templateId = [Select id from EmailTemplate where DeveloperName = 'C501_RegSite_Class_Registration_Confirmation_Message'].Id; | ||
|
||
//String emailMessage = Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name +Label.C501_RegSite_EmailConfirmP2+' '+nextStartDate+' '+Label.C501_RegSite_EmailConfirmP3+' '+teacherName+Label.C501_RegSite_EmailConfirmP4; | ||
//C501_UTIL_ClassRegUtilities.SendEmailGeneric('[email protected]',parent.Email,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name,emailMessage); | ||
C501_UTIL_ClassRegUtilities.SendEmailGeneric('[email protected]',null,null,null,term.Id,templateId,parent.Id); | ||
|
||
C501_UTIL_ClassRegUtilities.logActivityToContact(parent.Id,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name, emailMessage,'Email'); | ||
//C501_UTIL_ClassRegUtilities.logActivityToContact(parent.Id,Label.C501_RegSite_ConfirmSMS+' '+schoolNameText.Name, emailMessage,'Email'); | ||
} | ||
pageStatus = 'finished'; | ||
return null; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,12 +191,12 @@ public class C501_UTIL_ClassRegUtilities { | |
public static void sendEmailConfirmation(ID AcctID, String emailAddress){ | ||
Class_Site_Login_Attempt__c att = generateLoginCode(AcctID, emailAddress); | ||
String message = Label.C501_ClassReg_CodeMessage + ' '+att.Secret_Code__c + ' ' +Label.C501_ClassReg_CodeMessageDisclaim+' '+Label.C501_ClassReg_CodeMessageExpire; | ||
SendEmailGeneric('[email protected]',emailAddress,Label.C501_ClassReg_ConfirmCodeSubject,message); | ||
SendEmailGeneric('[email protected]',emailAddress,Label.C501_ClassReg_ConfirmCodeSubject,message,null,null,null); | ||
insert att; | ||
} | ||
|
||
public static void SendEmailGeneric(String fromAddress,String toAddress,String subject,String message){ | ||
// Blatantly stolen from here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm | ||
public static void SendEmailGeneric(String fromAddress,String toAddress,String subject,String message,ID associatedRecord,ID templateId,ID targetRecord){ | ||
// Blatantly stolen from here and modified: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm | ||
|
||
// First, reserve email capacity for the current Apex transaction to ensure | ||
// that we won't exceed our daily email limits when sending email after | ||
|
@@ -210,33 +210,50 @@ public class C501_UTIL_ClassRegUtilities { | |
// that will send out a single email to the addresses in the To, CC & BCC list. | ||
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | ||
|
||
OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = :fromAddress and IsAllowAllProfiles = true]; | ||
if(owea.size() > 0){ | ||
mail.setOrgWideEmailAddressId(owea.get(0).Id); | ||
} | ||
|
||
|
||
// Strings to hold the email addresses to which you are sending the email. | ||
List<String> toAddresses = new List<String>(); | ||
toAddresses.add(toAddress); | ||
|
||
if(owea.size() == 0){ | ||
// Specify the address used when the recipients reply to the email. | ||
mail.setReplyTo(fromAddress); | ||
|
||
// Specify the name used as the display name. | ||
mail.setSenderDisplayName('Techbridge Girls'); | ||
} | ||
|
||
// Assign the addresses for the To and CC lists to the mail object. | ||
mail.setToAddresses(toAddresses); | ||
|
||
// Specify the address used when the recipients reply to the email. | ||
mail.setReplyTo(fromAddress); | ||
|
||
// Specify the name used as the display name. | ||
mail.setSenderDisplayName('Techbridge Girls'); | ||
|
||
// Specify the subject line for your email address. | ||
mail.setSubject(subject); | ||
|
||
// Set to True if you want to BCC yourself on the email. | ||
mail.setBccSender(false); | ||
|
||
// Optionally append the salesforce.com email signature to the email. | ||
// The email address of the user executing the Apex Code will be used. | ||
mail.setUseSignature(false); | ||
|
||
// Specify the text content of the email. | ||
mail.setPlainTextBody(message); | ||
|
||
mail.setHtmlBody('<p>'+message+'</p>'); | ||
// if we are using a template, set that. If not, send with supplied variables. | ||
if(templateId != null && associatedRecord != null){ | ||
mail.setTemplateID(templateId); | ||
mail.setTargetObjectId(targetRecord); | ||
mail.setWhatId(associatedRecord); | ||
// save a copy of this as an activity to the supplied contact ie target record | ||
mail.setSaveAsActivity(true); | ||
} else { | ||
// Specify the subject line for your email address. | ||
mail.setSubject(subject); | ||
|
||
// Assign the addresses for the To and CC lists to the mail object. | ||
mail.setToAddresses(toAddresses); | ||
|
||
// Set to True if you want to BCC yourself on the email. | ||
mail.setBccSender(false); | ||
|
||
// Optionally append the salesforce.com email signature to the email. | ||
// The email address of the user executing the Apex Code will be used. | ||
mail.setUseSignature(false); | ||
|
||
// Specify the text content of the email. | ||
mail.setPlainTextBody(message); | ||
|
||
mail.setHtmlBody('<p>'+message+'</p>'); | ||
} | ||
|
||
// Send the email you have created. | ||
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); | ||
|
40 changes: 40 additions & 0 deletions
40
src/dashboards/Public_Dashboards/Class_registration_datax.dashboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Dashboard xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<backgroundEndColor>#FFFFFF</backgroundEndColor> | ||
<backgroundFadeDirection>Diagonal</backgroundFadeDirection> | ||
<backgroundStartColor>#FFFFFF</backgroundStartColor> | ||
<dashboardType>SpecifiedUser</dashboardType> | ||
<isGridLayout>false</isGridLayout> | ||
<leftSection> | ||
<columnSize>Medium</columnSize> | ||
<components> | ||
<autoselectColumnsFromReport>true</autoselectColumnsFromReport> | ||
<chartAxisRange>Auto</chartAxisRange> | ||
<componentType>Pie</componentType> | ||
<displayUnits>Auto</displayUnits> | ||
<drillEnabled>false</drillEnabled> | ||
<drillToDetailEnabled>false</drillToDetailEnabled> | ||
<enableHover>false</enableHover> | ||
<expandOthers>true</expandOthers> | ||
<groupingSortProperties/> | ||
<header>Class Reg's This Year by Method</header> | ||
<legendPosition>Bottom</legendPosition> | ||
<report>unfiled$public/Class_Reg_s_by_Signup_Method_This_Year</report> | ||
<showPercentage>true</showPercentage> | ||
<showValues>true</showValues> | ||
<sortBy>RowLabelAscending</sortBy> | ||
<useReportChart>false</useReportChart> | ||
</components> | ||
</leftSection> | ||
<middleSection> | ||
<columnSize>Medium</columnSize> | ||
</middleSection> | ||
<rightSection> | ||
<columnSize>Medium</columnSize> | ||
</rightSection> | ||
<runningUser>[email protected]</runningUser> | ||
<textColor>#000000</textColor> | ||
<title>Class registration data</title> | ||
<titleColor>#000000</titleColor> | ||
<titleSize>12</titleSize> | ||
</Dashboard> |
6 changes: 6 additions & 0 deletions
6
src/email/unfiled$public/C501_Class_Registration_Confirmation_VF.email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<messaging:emailTemplate subject="Confirmation for your class registration" recipientType="Contact" relatedToType="School_Term__c"> | ||
<messaging:plainTextEmailBody > | ||
Congratulations! | ||
This is your new Visualforce Email Template. | ||
</messaging:plainTextEmailBody> | ||
</messaging:emailTemplate> |
11 changes: 11 additions & 0 deletions
11
src/email/unfiled$public/C501_Class_Registration_Confirmation_VF.email-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<EmailTemplate xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>46.0</apiVersion> | ||
<available>true</available> | ||
<encodingKey>ISO-8859-1</encodingKey> | ||
<name>Class Registration: Confirmation Message</name> | ||
<style>none</style> | ||
<subject>Confirmation for your class registration</subject> | ||
<type>visualforce</type> | ||
<uiType>Aloha</uiType> | ||
</EmailTemplate> |
20 changes: 20 additions & 0 deletions
20
src/email/unfiled$public/C501_RegSite_Class_Registration_Confirmation_Message.email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Student Name | ||
|
||
Student Email | ||
|
||
Student Phone | ||
|
||
Address | ||
|
||
School | ||
|
||
Grade | ||
|
||
Transportation home after Techbridge Girls program ends: | ||
|
||
|
||
Individuals Authorized to Pickup Your Child | ||
|
||
Emergency Contact(s) | ||
|
||
Student Birthdate |
10 changes: 10 additions & 0 deletions
10
src/email/unfiled$public/C501_RegSite_Class_Registration_Confirmation_Message.email-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<EmailTemplate xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<available>true</available> | ||
<encodingKey>ISO-8859-1</encodingKey> | ||
<name>Class Registration: Confirmation Message</name> | ||
<style>none</style> | ||
<subject>Confirmation for your class registration</subject> | ||
<type>text</type> | ||
<uiType>Aloha</uiType> | ||
</EmailTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,14 +89,14 @@ | |
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_ClassReg_CodeMessage</shortDescription> | ||
<value>Hello There! Your code for the Techbridge Girls registration system is:</value> | ||
<value>Your Techbridge Girls verification code is</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_ClassReg_CodeMessageDisclaim</fullName> | ||
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_ClassReg_CodeMessageDisclaim</shortDescription> | ||
<value>This is an unmonitored account so please don’t reply.</value> | ||
<value>. This phone number is unmonitored.</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_ClassReg_CodeMessageExpire</fullName> | ||
|
@@ -117,7 +117,7 @@ | |
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_ClassReg_EmergencySubtext</shortDescription> | ||
<value>In case the parent/guardian cannot be reached, please provide an EMERGENCY CONTACT.</value> | ||
<value>In case the parent/guardian cannot be reached, please provide an EMERGENCY CONTACT (other than yourself).</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_ClassReg_EvalStudy</fullName> | ||
|
@@ -419,6 +419,17 @@ We may also look at your child’s school information, like attendance and cours | |
<shortDescription>C501_RegSite_CodeMismatch</shortDescription> | ||
<value>That doesn't seem to match the code we sent you. Try again?</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_ConfirmContact</fullName> | ||
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_ConfirmContact</shortDescription> | ||
<value><p>If you have any questions or notice a mistake in your responses below, please contact the following regional coordinators based on where your student attends school:</p> | ||
|
||
<p>California or Pacific Northwest (WA, ID, OR, MT, AK) - <a href="mailto:[email protected]">[email protected]</a></p> | ||
|
||
<p>Washington DC Metro - <a href="mailto:[email protected]">[email protected]</a></p></value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_ConfirmMessageSite</fullName> | ||
<language>en_US</language> | ||
|
@@ -501,7 +512,7 @@ We may also look at your child’s school information, like attendance and cours | |
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_Grade</shortDescription> | ||
<value>Grade</value> | ||
<value>Grade (for 2018-19 school year)</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_InvalidEmailPhone</fullName> | ||
|
@@ -587,12 +598,19 @@ We may also look at your child’s school information, like attendance and cours | |
<shortDescription>C501_RegSite_PickUpChildError</shortDescription> | ||
<value>Please identify someone who can pick up your child from the program.</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_PlzAreaCode</fullName> | ||
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_PlzAreaCode</shortDescription> | ||
<value>Please include area code: (###) ###-####</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_ProvidePhoneEmail</fullName> | ||
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_ProvidePhoneEmail</shortDescription> | ||
<value>Please provide your phone number or email address to log in.</value> | ||
<value>Please provide your phone number or email address to access the student registration system.</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_ProvideStudentId</fullName> | ||
|
@@ -608,6 +626,13 @@ We may also look at your child’s school information, like attendance and cours | |
<shortDescription>C501_RegSite_RememberMeDevice</shortDescription> | ||
<value>Remember me on this device.</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_SMSweSentAnEmail</fullName> | ||
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_SMSweSentAnEmail</shortDescription> | ||
<value>An email with registration info has been sent to</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_SelectGrade</fullName> | ||
<language>en_US</language> | ||
|
@@ -634,7 +659,7 @@ We may also look at your child’s school information, like attendance and cours | |
<language>en_US</language> | ||
<protected>false</protected> | ||
<shortDescription>C501_RegSite_SiteRegFormTitle</shortDescription> | ||
<value>Techbridge Girls Class Registration Form</value> | ||
<value>Techbridge Girls Student Registration Form</value> | ||
</labels> | ||
<labels> | ||
<fullName>C501_RegSite_State</fullName> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.