You need to sign in to do that
Don't have an account?

Send email from batch class every 4 days from start date till case created
I have written a batch class that updates some date fields on the account. When one of the date field on the account date1 is equal to today , not only do i have to send an email, but i should send an email every 4 days starting from due date till a case is created for that account. A case gets created for an account via forum assmebly and that flags the value on the account. How can i approach this. Hopefully someone can help.
this is the part of cod in batch that adds accounts to list to whom a mail is sent accList.add(theAccount); if(theAccount.RocketPro_Renewal_Status__c == Label.RenewalStatus_NeedsRenewal && theAccount.RocketPro_isRenewal_Required__c==true){ emailaccList.add(theAccount); } if(theAccount.RocketPro_Next_Renewal_Date__c == System.today()){ theAccount.RocketPro_Renewal_Status__c == Label.RenewalStatus_NeedsRenewal; Label.RenewalStatus_NeedsRenewal&&theAccount.RocketPro_isRenewal_Required__c = true; emailaccList.add(theAccount);
Although there could be different ways to implement this one way that I could think of is to have a naxtdate field which has a date value of on what dates the email needs to be sent and while retrieving the records you can choose write the soql where the nextdate field has that dates value.
Also if the due date is less than 4 days then the nextdate would be that due date.
Let me know if this helps.
Regards,
Anutej