Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global void finish(Database.BatchableContext BC){
- System.debug('==== In finish start 2====');
- try{
- System.debug('==== In finish start ====');
- try{
- EmailHelper.sendEmails(emailList);
- }catch(Exception e){
- System.debug(e.getStackTraceString());
- exceptionList.add(e);
- } finally {
- if(!exceptionList.isEmpty()){
- System.debug('==== In finish ====');
- Messaging.SingleEmailMessage msg = EmailHelper.createEmailWithExceptions(exceptionList, 'BatchRenewChargeForTomorrow', new String[] {Constants.CSOLUTOR_EMAIL});
- List<Messaging.SingleEmailMessage> msgList = new List<Messaging.SingleEmailMessage>();
- msgList.add(msg);
- EmailHelper.sendEmails(msgList);
- }
- }
- } catch (Exception e2){
- System.debug(e2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement