Hello Salesforce Cody’s, Welcome back after a long time. Let’s do a quick Beginner/Intermediate level trigger.
trigger AccountTrigger on Account (after update) {
List<Id> listOfAccountIds = new List<Id>();
for(Account eachAccount : Trigger.New){
//only name modified then send email to related contact
if(eachAccount.Name != Trigger.oldmap.get(eachAccount.Id).Name){
listOfAccountIds.add(eachAccount.Id);
}
}
for(Contact c : [select Email from Contact where AccountId IN :listOfAccountIds]){
EmailManager.sendMail(c.Email, 'subject', 'body');
}
}