Posts

Showing posts from June, 2023

Email Merge Fields missing - resoling

1. Check field-level permissions. 2. if you are sending from apex check, in soql those fields are mentioned. 3. check the template name if you are cloning some templates. 4. check HTML code in template if any conditional display.

get Salesforce base url using apex

  URL.getSalesforceBaseUrl().toExternalForm();

How to delete .invalid In user Email (For selected emails only Or for all users) for newly created sandbox or refreshed sandbox

1. Create this class -------------------------------------------------------------------- public class EmailUtils {     public Static String removeInvalidDomain(String email) {         if (email != null && email.contains('@')) {             String[] parts = email.split('@');             String username = parts[0];             String domain = parts[1].toLowerCase();                          if (domain.endsWith('.invalid')) {                 domain = domain.substring(0, domain.length() - 8);             }                          return username + '@' + domain;         }                  return email; ...