mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 14:13:33 -07:00
send emails configured by categories.
can specify categories for both failed and successful emails close #35
This commit is contained in:
parent
ac793422fa
commit
2eb2e72bb3
1 changed files with 6 additions and 4 deletions
|
@ -184,7 +184,8 @@ do_exit() {
|
||||||
replaceVarBy "${REPLACEDRESULT}" "<cat>" "${NZBPP_CATEGORY}"
|
replaceVarBy "${REPLACEDRESULT}" "<cat>" "${NZBPP_CATEGORY}"
|
||||||
replaceVarBy "${REPLACEDRESULT}" "<script>" "${script}"
|
replaceVarBy "${REPLACEDRESULT}" "<script>" "${script}"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
if [ "$Email_successful" = "yes" -a "$nzbStatus" = 0 ]; then
|
for item in $Email_successful; do
|
||||||
|
if [ "${NZBPP_CATEGORY}" = "$item" -a "$nzbStatus" = 0 ]; then
|
||||||
User=""
|
User=""
|
||||||
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
||||||
replaceVarBy "${Email_Subject}" "<status>" "completed"
|
replaceVarBy "${Email_Subject}" "<status>" "completed"
|
||||||
|
@ -192,8 +193,9 @@ do_exit() {
|
||||||
replaceVarBy "${Email_Message}" "<status>" "completed"
|
replaceVarBy "${Email_Message}" "<status>" "completed"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
||||||
fi
|
fi; done
|
||||||
if [ "$Email_failed" = "yes" -a "$nzbStatus" != 0 ]; then
|
for item in $Email_failed; do
|
||||||
|
if [ "${NZBPP_CATEGORY}" = "$item" -a "$nzbStatus" != 0 ]; then
|
||||||
User=""
|
User=""
|
||||||
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
if [ -n "$Email_User" -a -n "$Email_Pass" ]; then User="-xu $Email_User -xp $Email_Pass" ; fi
|
||||||
replaceVarBy "${Email_Subject}" "<status>" "failed"
|
replaceVarBy "${Email_Subject}" "<status>" "failed"
|
||||||
|
@ -201,7 +203,7 @@ do_exit() {
|
||||||
replaceVarBy "${Email_Message}" "<status>" "failed"
|
replaceVarBy "${Email_Message}" "<status>" "failed"
|
||||||
Email_Message="${REPLACEDRESULT}"
|
Email_Message="${REPLACEDRESULT}"
|
||||||
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
$sendEmail -f "$Email_From" -t "$Email_To" -s "$Email_Server" $User -u "$Email_Subject" -m "$Email_Message"
|
||||||
fi
|
fi; done
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue