SalesforceFoundation / Volunteers-for-Salesforce

Volunteers for Salesforce managed package
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Use Developer Name of Email Template in Personal Site Contact Lookup Controller #348

Open jesslopez-sf opened 6 years ago

jesslopez-sf commented 6 years ago

The VOL_CTRL_PersonalSiteContactLookup Apex class queries for an Email Template using the Name field. If a customer renames the Email Template, it results in a "nullREQUIRED_FIELD_MISSING: Email body is required" error on the PersonalSiteContactLookup Visualforce page.

Proposing we instead query on DeveloperName instead in case they rename. https://github.com/SalesforceFoundation/Volunteers-for-Salesforce/blob/master/src/classes/VOL_CTRL_PersonalSiteContactLookup.cls#L91

Current Query: list<EmailTemplate> listT = [select Id from EmailTemplate where Name='Volunteers Personal Site Contact Lookup' limit 1];

Proposed Query: list<EmailTemplate> listT = [select Id from EmailTemplate where DeveloperName='Volunteers_Personal_Site_Contact_Lookup' limit 1];

Other areas of the package are using the DeveloperName when querying against the EmailTemplate object.

jesslopez-sf commented 6 years ago

**lurch: add

LurchTheButler commented 6 years ago

Tracking W-025094