Here is my custom template:
Code: Select all
##
## Default Email template for SABnzbd
## This a Cheetah template
## Documentation: http://sabnzbd.wikidot.com/email-templates
##
## Newlines and whitespace are significant!
##
## These are the email headers
<!--#if $cat == "tv" #-->
subject: SABnzbd has <!--#if $status then "completed" else "failed" #--> job $name
to: $to
from: $from
date: $date
subject: SABnzbd has <!--#if $status then "completed" else "failed" #--> job $name
X-priority: 5
X-MS-priority: 5
## After this comes the body, the empty line is required!
Hi,
<!--#if $status #-->
SABnzbd has downloaded "$name" <!--#if $msgid=="" then "" else "(newzbin #" + $msgid + ")"#-->
<!--#else#-->
SABnzbd has failed to download "$name" <!--#if $msgid=="" then "" else "(newzbin #" + $msgid + ")"#-->
<!--#end if#-->
Finished at $end_time
Downloaded $size
Results of the job:
<!--#for $stage in $stages #-->
Stage $stage <!--#slurp#-->
<!--#for $result in $stages[$stage]#-->
$result <!--#slurp#-->
<!--#end for#-->
<!--#end for#-->
<!--#if $script!="" #-->
Output from user script "$script" (Exit code = $script_ret):
$script_output
<!--#end if#-->
<!--#if $status #-->
Enjoy!
<!--#else#-->
Sorry!
<!--#end if#-->
<!--#end if#-->
The template does work, except the resulting email does not have a subject, which is because the "subject:" value comes after the if statement.
But if I pull the if statement up I end up receiving emails for all downloads.
Does anyone have any ideas how to fix this?
Cheers,
Kent