should prevent bad error message from uploaded invoices.
This commit is contained in:
@@ -20,9 +20,7 @@
|
||||
|
||||
(defn send-email-about-failed-message [mail-bucket mail-key message]
|
||||
(let [target-key (str "failed-emails/" mail-key ".eml")
|
||||
target-url (str "http://" (:data-bucket env)
|
||||
".s3-website-us-east-1.amazonaws.com/"
|
||||
target-key)]
|
||||
target-url (str "https://" (:data-bucket env) "/" target-key)]
|
||||
(alog/info ::sending-failure-email :who (:import-failure-destination-emails env))
|
||||
(s3/copy-object mail-bucket mail-key (:data-bucket env) target-key)
|
||||
(ses/send-email {:destination {:to-addresses (:import-failure-destination-emails env)}
|
||||
@@ -66,8 +64,8 @@
|
||||
:content-length (.length (io/file filename))})
|
||||
(let [imports (->> (parse/parse-file filename filename)
|
||||
(map #(assoc %
|
||||
:source-url (str "http://" (:data-bucket env)
|
||||
".s3-website-us-east-1.amazonaws.com/"
|
||||
:source-url (str "https://" (:data-bucket env)
|
||||
"/"
|
||||
s3-location)
|
||||
:import-status :import-status/imported)))]
|
||||
(alog/info ::found-imports :imports imports)
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
(mapcat (fn [k]
|
||||
(try
|
||||
(let [invoice-key (copy-readable-version k)
|
||||
invoice-url (str "http://" bucket-name ".s3-website-us-east-1.amazonaws.com/" invoice-key)]
|
||||
invoice-url (str "https://" bucket-name "/" invoice-key)]
|
||||
(with-open [is (-> (s3/get-object {:bucket-name bucket-name
|
||||
:key k})
|
||||
:input-stream)]
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
(mapcat (fn [k]
|
||||
(try
|
||||
(let [invoice-key (str "invoice-files/" (UUID/randomUUID) ".csv") ;
|
||||
invoice-url (str "http://" (:data-bucket env) ".s3-website-us-east-1.amazonaws.com/" invoice-key)]
|
||||
invoice-url (str "https://" (:data-bucket env) "/" invoice-key)]
|
||||
(s3/copy-object {:source-bucket-name (:data-bucket env)
|
||||
:destination-bucket-name (:data-bucket env)
|
||||
:source-key k
|
||||
|
||||
Reference in New Issue
Block a user