Sql-server – Sql Server Agent notification email with custom message

sql serversql-server-agent

I have set email notification on the completition of a scheduled job.

Is it possible to customize the email content?

Best Answer

The way I've done this in the past is added a final step to the job, then I can use Database Mail to customize everything about the message (subject, body, recipients, from, etc) based on the server, the status/outcome of the job, and even the duration.

It is cumbersome if you have a lot of jobs, but I did this for a variety of other reasons as well (for example, other actions to perform in addition to sending an e-mail).

You may also consider a management tool like SQL Sentry which provides lots of flexibility over how to handle successful/failed jobs, and has comprehensive options for subsequent actions.