# リンクの有効期限は送信時に既に切れていました

**URL:** <https://meta.discourse.org/t/link-activation-already-expired-when-sent/46090>\
**Category:** Product Support\
**Created:** [2016 年 6 月 20 日午後 10:17 UTC](https://meta.discourse.org/t/link-activation-already-expired-when-sent/46090 "2016-06-20T22:17:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![brunoedigital](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brunoedigital/32/119692_2.png) [@brunoedigital](https://meta.discourse.org/u/brunoedigital)\
**Post date:** [2016 年 6 月 20 日午後 10:17 UTC](https://meta.discourse.org/t/link-activation-already-expired-when-sent/46090/1 "2016-06-20T22:17:24Z")

</div>

Hey folks. We developed a custom plugin to integrate my payment system with Discourse.

Basically what it does is that it creates a new user based on a POST notification sent by my payment system where it creates a new user and then assign a expiration date for his access.

You can see the plugin here: [GitHub - maysam/discourse\_subscription\_plugin: Deactivate users beyond their expiration date · GitHub](https://github.com/maysam/discourse_subscription_plugin.git)

It’s working fine with only one problem:

When a new user is created, an automatic email is sent out — the “Account Created” email.

When I click the link to create a new password (which is actually the password reset link), it opens a page saying:

“Sorry this is an old link. Please click ‘forgot password’ to get a new email”.  
(or something along these lines)

We are not really sure why this happening. Why the %{email\_token} is getting screwed up in that first email.

BTW, it’s just the **first** email. If I click to send a new email to set a new password, then this link works fine.

It seems that whenever we make a change to the user — activate it, change expiration date or whatever — the token will get expired.

If it’s indeed that, we need a way to first do everything we need (activating, setting groups, expiration date, etc) and then send that first email.

But no idea if that’s really what’s going on.

If anyone has any idea we’re more than happy to hear your out 🙂

Thanks!  
-Bruno

---

_[View the full topic](https://meta.discourse.org/t/link-activation-already-expired-when-sent/46090)._
