scheduled flow + vf email template demo
I have built out a demo scheduled flow that sends an email to each opportunity owner with a list of open opportunities, using a visualforce email template. This flow is much like a report subscription, but with more context, and without nearly as much work of scheduling subscriptions to N users. And - no 5 subscription limit!
The basic approach is covered in this article - which was built on custom objects in our HR system.
In order to avoid hitting the flow iteration limit from building a unique collection of owner Ids (which I can do using this hackish but inefficient approach), I built an invocable apex class that takes a sobject collection and a field, and returns a unique collection of values. This could have some other interesting uses, and opens this flow up to run on up to about 1990 unique active owners, which is pretty robust by my standards…Above that value, you will...