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
lucena69lucena69 

Keeping Activity History on the Contact, disabling New Task emails to the User

Hello,

 

I want to send an email to a Contacts associated with a Project (custom object) when the status of the Project changes.
I have done this by implementeing the follow code in an after update trigger on the Project__c

 

(core snippet):

 

for (Project__c project: listProjectNotifyContact)
{
    Messaging.SingleEmailMessage mailSingle = new Messaging.SingleEmailMessage();
    mailSingle.setTargetObjectId(project.Contact__c);
    mailSingle.setWhatId(project.id);
    mailSingle.setTemplateId(idNotifyTemplate);
    mailSingle.setSaveAsActivity(true);
    mailSingle.setOrgWideEmailAddressId(idOrgWide);
    listSingleEmailMessage.add(mailSingle);           
}

 

This seems to work just fine. I'm using a VisualForce email template and that is fine too.

Unfortunately what I'm not happy about is that we seem to keep getting "New Task" email notifications sent to the User who changes the status. (These notifications include a copy of the email that was sent to the Contact).

I want to preserve activity the Contact level (so we have the history that the email was sent) but we are getting tired of all the "New Task" email notifications.

 

Is it possible to disable those New Task email notifications at the User level, but keep the activity history for the Contact?

 

Thanks,
-lucena

dmchengdmcheng

Good question.  I don't think there is a way to disable the email notification on the activity records that you are creating, even though they are defaulting to completed.