You need to sign in to do that
Don't have an account?
Michael Andrews 5
Email list of accounts every X days
We have a catagory of accounts that need to receive an email every 10 days until a checkmark is removed from thier account. I tried using a workflow that triggered the email and delayed the next email. This worked but I ran into a limit on the number of delayed workflow jobs available.
I was thinking of switching this task to something like an Apex Schedualed class that would check for the account bit and send the email. Is this the best way to handle this?
My sudo code would be something like this:
I was thinking of switching this task to something like an Apex Schedualed class that would check for the account bit and send the email. Is this the best way to handle this?
My sudo code would be something like this:
- (run every day)
- query for list of accounts that have not received an email in more than 9 days.
- update the record with something that would trigger an email
- the tiggered email would update the date of last email
- Create One Field Which can capture Last Date on which Email was Sent
- Create one Field which can be set to true when need to considered for email
- Create one Formula Field which will be true when Email was sent 10 days back AND Check box for sending email is true
- Create Batch class and Query only those fields where formula field is true this will reduce the burden on batch in terms of how many records u can query
- Update Date and send email through the batch only, trigger be extra work i think u can manage it within the same batch job.
- Then finally u can have a schedule class
Let me know if u further need detailsThank you JSign9 for the reply the batch class is interesting but mass email looks like a better fit.