1

When the below code runs:

ContentVersion doc = new Contentversion();
doc.title = fileId + '.pdf';
doc.versiondata = contentData;
doc.PathOnClient = '/filename.pdf';
doc.FirstPublishLocationId = fileId;
insert doc;

doc = getContentVersionById(doc.Id);

ContentDocumentLink link = new ContentDocumentLink();
link.LinkedEntityId = getUserId();
link.ContentDocumentId = doc.ContentDocumentId;
link.ShareType = 'V';
insert link;

Salesforce sends an email to the user.

How do I stop Salesforce from sending the email, but still share the file?

1 Answer 1

2

Unfortunately, I ended with finding this idea on google:- Not send File shared notification email

It says The organization have disable to "Chatter Messages" function. When "Received Email" option on Chatter Email Settings is enabled, File Shared notification email always sent. The option that controls this mail is not being provided.

It means each user should opt out this option in your org to make it work but at the cost of many other chatter notification types. We don't have control at the org level.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .