Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email transcript use case #34

Merged
merged 10 commits into from
Nov 30, 2023
Merged

Email transcript use case #34

merged 10 commits into from
Nov 30, 2023

Conversation

lucieyang1
Copy link
Member

@lucieyang1 lucieyang1 commented Nov 27, 2023

Description

  • Gets the messages from the session and formats it into a transcript string

Fixes # (issue)

  • SessionId and SessionCode no longer get removed from the session storage, is that ok?

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Manually tested. Make sure to get the associated backend branch for code review.
image

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code

@lucieyang1 lucieyang1 changed the title Email transcript Email transcript use case Nov 27, 2023
Copy link

netlify bot commented Nov 27, 2023

Deploy Preview for callhub ready!

Name Link
🔨 Latest commit 7f6d190
🔍 Latest deploy log https://app.netlify.com/sites/callhub/deploys/656821679325780008c6a2f8
😎 Deploy Preview https://deploy-preview-34--callhub.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lucieyang1 lucieyang1 self-assigned this Nov 27, 2023
Copy link
Collaborator

@zjayee zjayee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked out the branch and the email transcript sending works on my end! Overall, coding is clear and follows style conventions. Just one question about the api.

const emailRef = useRef();
const sessionCode = sessionStorage.getItem("sessionCode");

useEffect(() => emailjs.init("OScF2lHq5ESl_o9lU"), []);
Copy link
Member Author

@lucieyang1 lucieyang1 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it’s a public API key. I followed their website, which says it’s ok to expose it? https://www.emailjs.com/docs/faq/is-it-okay-to-expose-my-public-key/

I can see why we might want to move it though. Will do.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use environment variable for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried putting the key into an .env file, but for some reason, it shows up as undefined when I try to run the code. There might be something wrong with what I'm doing, though I searched google and it seems like someone had the same issue 2 years ago, that went unresolved: https://stackoverflow.com/questions/66491790/why-can-t-i-send-messages-with-emailjs-when-hiding-my-keys-in-env

const emailRef = useRef();
const sessionCode = sessionStorage.getItem("sessionCode");

useEffect(() => emailjs.init("OScF2lHq5ESl_o9lU"), []);
Copy link
Member Author

@lucieyang1 lucieyang1 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it’s a public API key. I followed their website, which says it’s ok to expose it? https://www.emailjs.com/docs/faq/is-it-okay-to-expose-my-public-key/

I can see why we might want to move it though. Will do.

Copy link
Collaborator

@sarinali sarinali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comment

Copy link
Member

@3milyfz 3milyfz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

  • Tested locally and it works as expected
  • Just a minor comment on use of alert.

Comment on lines 120 to 122
alert("Email successfully sent. Check inbox.");
} catch (error) {
alert("Oops! Something went wrong while trying to send the email. Please make sure there are messages in the conversation before sending.");
Copy link
Member

@3milyfz 3milyfz Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the alerts to mui alerts to stay consistent with the ones in my pull request?

@lucieyang1 lucieyang1 requested a review from 3milyfz November 29, 2023 22:21
Copy link
Member

@3milyfz 3milyfz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lucieyang1 lucieyang1 merged commit ee6b1f4 into main Nov 30, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants