Selaa lähdekoodia

Merge pull request #16 from rjhbrunt/master

fix for missing html body
Siddharth Dushantha 5 vuotta sitten
vanhempi
sitoutus
512a26611e
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      tmpmail

+ 1 - 0
tmpmail

@@ -194,6 +194,7 @@ view_email() {
     FROM=$(jq -r ".from" <<<"$DATA")
     FROM=$(jq -r ".from" <<<"$DATA")
     SUBJECT=$(jq -r ".subject" <<<"$DATA")
     SUBJECT=$(jq -r ".subject" <<<"$DATA")
     HTML_BODY=$(jq -r ".htmlBody" <<<"$DATA")
     HTML_BODY=$(jq -r ".htmlBody" <<<"$DATA")
+    [ -z "$HTML_BODY" ] && HTML_BODY=$(jq -r ".textBody" <<<"$DATA")
 
 
     # Create the HTML with all the information that is relevant and then
     # Create the HTML with all the information that is relevant and then
     # assigning that HTML to the variable HTML_MAIL. This is the best method
     # assigning that HTML to the variable HTML_MAIL. This is the best method