First time posting and I'm quite new to SF. I've ended up on this site a lot when Googling to help me with issues - so thanks!
On my org, we're uploading some opportunities via DataLoader.io that will then send emails out to external contacts.
This was done via process builder - the opportunity has a specific record type and stage for the process to be followed. While it does complete the first action for all the records(which is a simple record update), the 2nd action is to call an invocable method to send the email out. In this case it's only actioning the first 3 records in the upload for the invocable method.
Global class sendInvoiceSurvey {
@InvocableMethod
public static void sendInvoiceEmail(List<opportunity>InvoiceContact){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(InvoiceContact[0].Fee_Contact__c);
mail.setTemplateId('00X24000000F1iy');
mail.setSaveAsActivity(true);
mail.setWhatId(InvoiceContact[0].Id);
mail.setBccSender(true);
mail.setSenderDisplayName('INSP');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
} }
I'm really lost as to why this is only working the first 3 records. Are there any limits that is preventing other emails going out? Or an issue with my code/process?
Any help would massively appreciated!
InvoiceContact
. But you only send an email to the first record of your list.