function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raluca JiboteanRaluca Jibotean 

Email template

Hello,

I created the object Vehicles which has also these fields: Last examination, Number of days between examinations, Next examination. The Next examination field is a formula field calculated using the last examination + number of days between examinations.

How can I check everyday which examination is going to take place the following day and how can I send an e-mail to the account that has that vehicle? It's about email template, but how can I generate it? I want to send an e-mail to each account one day before the day when the examination should take place.

Thanks!
Arthur ImirzianArthur Imirzian
You should use Apex Scheduler to run everyday an SOQL Query to retrieve all Vehicles with Next_examination__c - Today() = 1.
Then you can use Email Template to send formated emails to them.
For email template you can either use Apex or Workflow.

Apex Scheduler
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm