I have the following template;
## polly template
<!--#if $cat == "tv" and $status #--><!--#slurp#-->
To: girlfriends.email@domain.com
From: $from
Date: $date
Subject: SERIE - $name
X-priority: 5
X-MS-priority: 5
$name
is now available...
<!--#end if#-->
The template works, but the mail is not sent to "girlfriends.email@domain.com" but to the emailaddress specified in the sabnzbd email configuration screen. I'm running 0.6.15.
Am I doing something wrong or is this a bug?
Email Template hardcoded recipient not working?
Forum rules
Help us help you:
Help us help you:
- Are you using the latest stable version of SABnzbd? Downloads page.
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: Email Template hardcoded recipient not working?
Did you also tell SABnzbd where to look for the new template?
Where did you store it?
Where did you store it?
Re: Email Template hardcoded recipient not working?
I have two templates;
email-polly.tmpl
email-ronner.tmpl
both are in /home/media/.sabnzbd/emailtemplates and this folder is also the folder that is set in the Sabnzbd configuration as the Email Templates Folder.
Like I said, the templates work, the emails are being sent, but they are simply always sent to the address that is in the Sabnzbd settings, instead of to the hardcoded address I specified in the template (in the above example "To: girlfriends.email@domain.com")
email-polly.tmpl
email-ronner.tmpl
both are in /home/media/.sabnzbd/emailtemplates and this folder is also the folder that is set in the Sabnzbd configuration as the Email Templates Folder.
Like I said, the templates work, the emails are being sent, but they are simply always sent to the address that is in the Sabnzbd settings, instead of to the hardcoded address I specified in the template (in the above example "To: girlfriends.email@domain.com")
Re: Email Template hardcoded recipient not working?
I remember now a case from the past.
The "To" field from template isn't actually used because it would prohibit SABnzbd
from sending a conditional email to a range of recipients.
Conditional allows you to send a different email based on the name of the recipient.
In your case you would put rolly's and ronner's email addresses (separated by commas) in SABnzbd's UI.
Then make each email template conditional based on the recipient's email address.
The "To" field from template isn't actually used because it would prohibit SABnzbd
from sending a conditional email to a range of recipients.
Conditional allows you to send a different email based on the name of the recipient.
In your case you would put rolly's and ronner's email addresses (separated by commas) in SABnzbd's UI.
Then make each email template conditional based on the recipient's email address.
Re: Email Template hardcoded recipient not working?
I think I catch your drift on how to do this, but could you give an example on how I would check this in the template?
Re: Email Template hardcoded recipient not working?
We have a Wiki with lots of info
http://wiki.sabnzbd.org/email-templates
http://wiki.sabnzbd.org/email-templates
Re: Email Template hardcoded recipient not working?
[SarcasmMode]Oh you mean the wiki that states "If you want to use different email formats based on the email recipient, you should hard-code the recipient(s) in the template and not use the $to variable." And the same wiki that has an example template on conditional mails that doesn't work because for some strange reason it needs a ## comment on the first line for it to work.[/SarcasmMode]
That wiki? ;-)
That wiki? ;-)
Re: Email Template hardcoded recipient not working?
You mean the one that was just updated because it was no longer accurate?
Yes, that one!
Yes, that one!
Re: Email Template hardcoded recipient not working?
That got updated after I posted my sarcasm ;-)
Thx for the help btw
Thx for the help btw
Re: Email Template hardcoded recipient not working?
Of course it was, where would we be without community support?Ronner wrote:That got updated after I posted my sarcasm ;-)
Re: Email Template hardcoded recipient not working?
Very true, and with that spirit in mind, this is the way I did it now and this works;
#encoding utf-8
<!--#if $cat == "tv" and $status and $to == "email@domain.com" #--><!--#slurp#-->
To: $to
From: $from
Date: $date
Subject: SERIE - $name
X-priority: 5
X-MS-priority: 5
$name
is now available...
<!--#end if#-->
#encoding utf-8
<!--#if $cat == "tv" and $status and $to == "email@domain.com" #--><!--#slurp#-->
To: $to
From: $from
Date: $date
Subject: SERIE - $name
X-priority: 5
X-MS-priority: 5
$name
is now available...
<!--#end if#-->

