[SalesForce] Send email when changing Lead owner via Apex

What is the best way to trigger an email when I am changing the Owner of a Lead using Apex/Sforce API? I would like the email to go out to the new owner to let them know about this.

The best that I have come up with so far is to add it to a specific campaign and have a workflow rule looking for Lead updates to that campaign. But I was hoping that there was an easier way (something like a workflow rule triggered on changes to the Owner field) – since this requires creating an artificial Campaign on the site just needed for this workflow.

Best Answer

Use workflow, criteria would be when the lead owner id changed, and then add an email alert to it ...

Apex is totally possible, but a gross overkill, and also subject to limits on how many emails can be sent in one day.

Related Topic