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

Encoding unicode in "friendly-from" field #1990

Merged
merged 6 commits into from
Sep 27, 2023
Merged

Conversation

smcmurtry
Copy link
Contributor

@smcmurtry smcmurtry commented Sep 25, 2023

Summary | Résumé

This PR changes the way we are encoding the "friendly from" field in the email headers, so that we can include non-ascii characters that show up in service names. The AWS documentation provided examples of how to do this. There are 2 steps:

  1. encode the utf-8 characters as base64
  2. replace the ascii-encoded "friendly from" field with "MIME encoded-word syntax" that includes the base64 encoded string

Here is a link to the AWS docs that I used.

Test instructions | Instructions pour tester la modification

Reproduce the bug:

  1. log into staging
  2. visit your service settings page
  3. change the name of your service to Accent service èé ÀÂËÎÏÔŒÙÛâçêëîïôœû
  4. send an email to yourself
  5. observe that the accents are missing from the "friendly from" part of the the email:
Screenshot 2023-09-26 at 10 27 55 AM

Test the fix:

  1. Check out this branch and run the api locally
  2. connect the locally running admin
  3. log in and visit your service page
  4. change the name of your service to Accent service èé ÀÂËÎÏÔŒÙÛâçêëîïôœû
  5. send an email to yourself
  6. observe that the accents are displayed correctly from the "friendly from" part of the the email:
Screenshot 2023-09-26 at 10 33 02 AM

@smcmurtry smcmurtry marked this pull request as ready for review September 26, 2023 17:00
@smcmurtry smcmurtry changed the title Unicode in "friendly-from" Encoding unicode in "friendly-from" field Sep 26, 2023
Copy link
Contributor

@whabanks whabanks left a comment

Choose a reason for hiding this comment

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

Tested locally and the accents are present as expected, LGTM!
image

@smcmurtry smcmurtry merged commit ec14c43 into main Sep 27, 2023
4 checks passed
@smcmurtry smcmurtry deleted the fix/unicode-in-friendly-from branch September 27, 2023 14:52
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.

2 participants