0

I'm trying to use a custom setting to store email addresses to be used when sending out an Excel file of an Apex job that deactivates users and I'm not exactly sure how to do so. I setup a custom setting as a string and put '[email protected]' but I keep getting "Method does not exist or incorrect signature" error.

Currently, my code is

Batch_Settings__c batchSettings = Batch_Settings__c.getInstance();

String deactivationEmails = batchSettings.DeactivatedUsersListemails__c;

// Apex batch code

Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();

.........

email.setToAddresses(deactivationEmails); // This is where the error is occuring

Any help is appreciated!

1 Answer 1

1

Settoaddresses method accepts list of string and you are sending string as a parameter that's why it is failing

You must log in to answer this question.

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