function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TheMaryCTheMaryC 

MAss Email Triggers

I have the following trigger on a Task... it works fine when entering one task at a time. 

However, when I send out mass emails, the activity is logged, but the trigger doesn't fire?

 

I read an older post that stated mass emails will not fire the triggers...

Is there a way to get the trigger to fire when a mass email is sent...

 

Below is the trigger...

 

trigger updatelastemail on Task (after insert) {
  Task t = Trigger.new[0];
  
  if(t.WhoId != null) {
    Lead l = [select Id, LastEmail__c from Lead where Id=:t.WhoId];
    if(l != null) {
      l.LastEmail__c = t.Email_Number__c;
      update l;
    }    
  }
}

 

Any suggestions will be greatly appreciated.

 

Thanks
                 

SJTECH2009SJTECH2009
 seems this trigger is not bulk enabled make it as bulk enabled.