The job will send an HTML email with the latest error at specific job.
How to:
-
Add a last step at your already created job called "Send Failure Notification" pointing to the Database where you have the previous script.
-
in the Command window put:
-- Send Failure Notification
<msdb>.dbo.usp_JobErrorMessage
-- Required parameter to whom are you sending this email
'<group or name>@<company>.com'
-- Required parameter - job_id
, '<job_id>'
-- Optional parameter - default is 1 minute
, <Minutes>
-- Optional parameter - default is low
, <level of importance>
SAMPLE:
[DBEM].dbo.usp_JobErrorMessage
'vonpato@yahoo.com'
, 'E1A5E99B-3A30-40D5-B32D-89DBC78936DB'