Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Voicemail email time zone #78

Open
maekiteasy opened this issue Mar 9, 2022 · 2 comments
Open

Voicemail email time zone #78

maekiteasy opened this issue Mar 9, 2022 · 2 comments

Comments

@maekiteasy
Copy link

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"

@maekiteasy
Copy link
Author

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.

@henry-white89
Copy link

I would also like to request this feature be implemented. An environment variable for timezone would be most appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants