Skip to content

Instantly share code, notes, and snippets.

@kbs5280
Created May 23, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbs5280/46720a7f74f128f8d099be929377256b to your computer and use it in GitHub Desktop.
Save kbs5280/46720a7f74f128f8d099be929377256b to your computer and use it in GitHub Desktop.
private static Boolean sendable(Lead newLead, Set<Id> scheduledLeadIds) {
Boolean isTestRecord = newLead.Email != null ? newLead.Email.contains('+ostest') : false;
if((newLead.Email != null ||
Utilities.hasPhysicalAddress(newLead.Street, newLead.City, newLead.State, newLead.PostalCode)) &&
(newLead.CreatedDate >= Datetime.now().AddYears(-3) ||
scheduledLeadIds.contains(newLead.Id)) &&
!isTestRecord &&
newLead.Inbound_Call__c != Constants.NonSalesCall &&
newLead.Inbound_Call__c != null &&
newLead.ConvertedDate == null) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment