From 9a5281b2a25fcf57bd5374ca3012ea5f01667594 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Sun, 3 Sep 2023 12:52:21 -0400 Subject: [PATCH] Convert S3 body to string --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index aad4e25..5ca3e33 100644 --- a/index.js +++ b/index.js @@ -203,8 +203,12 @@ exports.fetchMessage = function(data) { return reject( new Error("Error: Failed to load message body from S3.")); } - data.emailData = result.Body.toString(); - return resolve(data); + result.Body.transformToString().then( + body => { + data.emailData = body; + resolve(data); + } + ); }); }); });