Use Process Builder!
1. Create a new Process.
2. Choose the object on which the process builder needs to be implemented Here, Lead is the object.
Note: Select the option ‘When a Record is created’.
3. Set the criteria according to your requirement. Here for eg,
Operator: is Null
4. Now, in the immediate action:
- Select Action Type: Apex
- Specify an Action name, Here: ‘Verify Email Address’.
- Select the Apex class ‘Verify Email From Process Builder’.
- Set Apex Variable as:
- Field: Email API
a. Field: Email API
b. Field: Record ID
Type: Field Reference
Here, supplied email is the API name of the field which consists of the email address.
[Lead].Id is the Id of the Record on which the email address is saved.
5. Click on save.