Hello,

While sending e-mails from "user verification" module, there are [user-verification:...] variables for the verification link and timeout that can be inserted within the e-mail body
Since I'm using another module for e-mail sending (rules + entity email), I don't see those variables there (but I see all tokens usually present under "replacement patterns", ex: user, node, site information, etc.)
Would it be possible to extend the "user" entity so that "user-verification" tokens can appear under it ? (like: [user:user-verification:link]

Thanks

Comments

doitDave’s picture

Yes, that is possible and I think it is a really nice suggestion.

Could we collect some concrete suggestions for tokens?

I would vote for

  • [user:verification:code] => The raw code hash.
  • [user:verification:url] => The verification link (AFAIR token.module provides chained properties like :relative etc.)
  • [user:verification:timeout] => The timeout date (most likely UNIX_TIMESTAMP? probably also reusable chains with date tokens?)
  • [user:verification:errors] => The number of validation errors so far.

Any other suggestions? Someone to propose a patch?

peter.bozovic’s picture

This looks very good for me :)
I don't know if the "timeout" token can be proposed in several formats so that administrator can choose exactly how he can display it

doitDave’s picture

Neither do I. I suppose token will take care of it. If not, I won't - that effort would really be out of this module's scope. We will see.

peter.bozovic’s picture

For me personnaly, it's really not so important. I will probably use generic text like "This link will expire in 24h"
Most important is the [user:verification:url] !

doitDave’s picture

If it's done, it has to be done properly.

doitDave’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Active » Fixed

The latest dev snapshot (may take some hours) now provides the [user:verification] token.

You can use the token browser (e.g. in the account verification config page) to examine their details.

Thx for the suggestion, it was a good opportunity to dig into the token API and make the module a step more drupalish. Of course, some feedback and testing would be nice!

Edit: I just realize, at the moment, you would have to pass the verification values to token_replace(). So we need to find a way to have these tokens at hand in every possible situation. Not sure whether to attach it to the user object in hook_user_load() and/or to provide an API function which retrieves this data. Suggestions?

doitDave’s picture

Status: Fixed » Needs review
doitDave’s picture

Generally reworked token management in the latest dev snapshot. Please check. Still needs testing whether the deprecated [user-verification:*] tokens still work for compatibility reasons.

doitDave’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

Also note that I will remove the extended token support from the 1.x branch again. This feature will not be part of D6. Also, any new feature will only be added to the 2.x branch.

doitDave’s picture

Title: [user-verification:...] tokens » [user:verification:*] tokens
doitDave’s picture

After re- and re-re-testing I think I have now covered all possible token scenarios. Please be so kind to test it all over. Changes are in the 7.x-2.x-dev branch within the next 12 hours.

Note that the 2.x branch needs to run update.php in order to work as the DB table needed some small logical change.

Looking forward to any feedback!

doitDave’s picture

Version: 7.x-2.x-dev » 7.x-2.0-alpha1

Now also available in 7.x-2.0-alpha1.

peter.bozovic’s picture

Hello,

Results of my testing:
- Email Verification activated and using e-mail verification e-mail sending - Works
- Added Rule for sending additional e-mail with the verification tokens - Works
- Removed the e-mail verification e-mail sending (trough configuration settings) - E-mail configure trough Rules is sent, but verification code is not available within the url !
When both e-mails received, i see correctly the url "...user/123/verify/98b7cd39bac505cfd5b7705edd8e0d7f"
However, when the "Send verification mail" option is disabled, the url returned by the token is only ".../user/123/" without the code part

Some other token results:
[entity-email-to:verification:url:absolute] - Works only if "Send verification mail" is active
[entity-email-to:verification:code] - Doesn't work in any case
[entity-email-to:verification:expires:short] - Works in both cases

It looks like we are getting close to the goal :)
Thanks

peter.bozovic’s picture

Hello,
Any news on this issue ?

doitDave’s picture

Issue summary: View changes

Hey, thanks for your report. If you are already using u_v, you might have noticed the increasing spam reg level in the last months. This means obviously that the current implementation has been worked around by the other side - which was to be expected and then, not too difficult.

So far for the bad news. The good news is, I am working on an all new, really more powerful solution at the moment with a totally different and, by the way, far more hard-to-beat approach.

As we will not deal with registration anymore by then, I will close this issue as won't fix. Hope you understand.

As for the actual issue, tokens will need revision anyway. So I will close this here.

doitDave’s picture

Status: Needs review » Closed (won't fix)

  • doitDave committed c49c120 on 7.x-3.x
    * #2109659 by peter.bozovic: Added [user:verification] tokens.
    *...
  • doitDave committed e8126ff on 7.x-3.x
    #2109659: Added :url chained token.
    
  • doitDave committed 0ce6a6d on 7.x-3.x
    #2109659:
    * Changed DB scheme and added update function.
    * Improved...
koushikuk’s picture

Can you please suggest how can I use token [user-verification:url:absolute] in my custom module file to send verification link?
Thanks in advance.