How to make email alerts customizable?

view story

http://serverfault.com – I'm running Nagios 3. It is generating the alerts that are based on my conditions that I had mentioned. What I want now is to customize my email alerts with a detailed messages. I need to send alerts for my tomcat logs along with the stack trace. In my commands.cfg file, I have command_line like this : command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -v -f x. (HowTos)