4

As part of sign up, I want the user to verify their email by copying the verification code from the email that has been sent to their personal email address, and then entering the code in the input screen to verify their email. Pretty standard.

However, on the email, I was thinking of incorporating a copy link next to the verification code. Which when clicked, copies the code and saves the user having to highlight the code themselves and then pressing copy. I think this link will be more helpful on mobile when copy and paste is a little more fiddly.

Example:

456873 copy

But I can not find this behaviour in other examples, is there a reason for not incorporating a copy button that I have missed? Or are there examples and I have not found them?

1
  • 1
    Haven't seen it either -- except in the phone UI itself where it autodetects a code and shows a toast with a copy option. Maybe on desktop it seems already convenient enough to do ctrl-c (or have two windows open and see both at once). Dec 18, 2023 at 22:48

1 Answer 1

5

If you're sending via email, you can't use Javascript due to security reasons, so the copy code feature won't work.

For SMS or app-based communication (like on mobile devices), phones often recognize codes, and when prompted for entry, they typically display an option like "code_goes_here" for easy selection.

In short: For emails, this functionality isn't possible – that's the straightforward explanation.

3
  • 3
    Unless they do something ridiculous like send you to a URL where JS copies the code on load and then closes the tab :) Dec 19, 2023 at 12:06
  • 1
    @LukeSawczak well, you never know...
    – Devin
    Dec 19, 2023 at 14:18
  • 1
    @LukeSawczak The clipboard API only works for user-initiated events (at least in Firefox), so that won't fly either. :(
    – fri
    Jan 8 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.