Skip to content

feature #3616 - "Set your account" password link in SMS activation messages#3700

Merged
compwron merged 15 commits into
rubyforgood:mainfrom
xihai01:f/3616
Jun 26, 2022
Merged

feature #3616 - "Set your account" password link in SMS activation messages#3700
compwron merged 15 commits into
rubyforgood:mainfrom
xihai01:f/3616

Conversation

@xihai01
Copy link
Copy Markdown
Collaborator

@xihai01 xihai01 commented Jun 25, 2022

What github issue is this PR for, if any?

Resolves #3616
A set up password link is now sent with the account creation SMS. In addition, this link and the "/users/edit" link to change SMS settings are shortened using short.io service.

Note: Short io credentials do not exist in production env yet, so the SMS links aren't sent. In cases where such as these when there are issues with short io API itself, a default msg is sent instead as shown in screenshot

What changed, and why?

  • created a function called handle_short_urls() for calling short io service to return a hash of shortened links
  • refactor SMS body message function to accept the hash and render returned messages dynamically based on the values inside the hash
  • refactor volunteer/super/admin controller create actions to handle short links in SMS

How is this tested? (please write tests!) 💖💪

  • refactor controller request specs to assert for short io service calls
  • add tests to application_controller specs for handle_short_urls()
  • add tests to spec/helpers to verify SMS body message functions return correct msgs

Screenshots please :)

SMS when short link service has issues
coming soon

Feelings gif (optional)

coming soon
![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

Feedback please? (optional)

We are very interested in your feedback! Please give us some :) https://forms.gle/1D5ACNgTs2u9gSdh9

@xihai01 xihai01 added ruby Touches Ruby code zzz_archived: 📱 SMS work relating to SMS notifications #1017 codethechange code.the.change developers labels Jun 25, 2022
@xihai01 xihai01 self-assigned this Jun 25, 2022
Comment thread .allow_skipping_tests
helpers/contact_types_helper.rb
helpers/date_helper.rb
helpers/template_helper.rb
helpers/api_base_helper.rb
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please write tests for code instead of ignoring them

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

got it

def handle_short_url(url_list)
hash_of_short_urls = {}
url_list.each_with_index { |val, index|
# call short io service to shorten url
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good comment

@compwron compwron marked this pull request as ready for review June 26, 2022 15:37
@compwron compwron merged commit b50bed4 into rubyforgood:main Jun 26, 2022
@compwron
Copy link
Copy Markdown
Collaborator

safe to merge

@compwron compwron added the 🧪 Tests Tests label May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codethechange code.the.change developers ruby Touches Ruby code 🧪 Tests Tests zzz_archived: 📱 SMS work relating to SMS notifications #1017

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send a "Set your password" link in account activation SMS message

2 participants