Open maekiteasy opened 2 years ago
With some direction from AWS support, I was able to modify the code. Here was my solution. Download the Lambda code package for the following two functions:
TranscriptionEventsLambdaFunction ContactVoicemailStreamLambdaFunction
Change the code in the following two javascript files for each package: transcription.js voicemail.js
sendMail(e, t, n, r) {
return new Promise((s, i) => {
let o = `<p>${(new Date(1e3*e.timestamp)).toLocaleString('en-US', { timeZone: 'America/Denver' })}</p>`;
if (o += `<p>New voicemail from ${e.contactPhoneNumber}.</p>`, r.transcription && (o += `<b>Voicemail Transcript:</b><p>${r.transcription.transcripts[0].transcript}</p>`), o += "<b>Voicemail:</b>", r.preSignedUrl) {
o += `<p>Voicemail Expiration Date: ${(new Date(1e3*Math.floor(Date.now()/1e3+r.preSignedUrl.expires))).toLocaleString('en-US', { timeZone: 'America/Denver' })}</p>`, o += `<p><a href="${r.preSignedUrl.url}">Click Here</a> to listen to the voicemail</p>`
}
Then re-zip the packages and upload them into the functions. I had trouble zipping in Windows due to file/path length, so I did it in Linux.
Next time I'll have to try cloning the dev branch and building my own. It would be great if there was an Environment Variable that could be easily edited in the Lambda function overview for this value.
I would also like to request this feature be implemented. An environment variable for timezone would be most appreciated.
I did see issue #11 mentioned the same thing, but wasn't sure if anyone would see my reply since it has been closed.
This is also an issue for our environment. It would be great if there was an easier way to change the time zone other than changing the code. Maybe there could be an environment variable in the Lambda function that could be easily changed to the desired value like "America/New_York" or "America/Denver"