mirror of
https://github.com/neocities/neocities.git
synced 2025-07-24 11:28:29 +02:00
easy unsubscribe baked into emails
This commit is contained in:
parent
39ce179d16
commit
be0267956b
6 changed files with 91 additions and 3 deletions
|
@ -206,6 +206,14 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
class << self
|
||||
def valid_email_unsubscribe_token?(email, token)
|
||||
email_unsubscribe_token(email) == token
|
||||
end
|
||||
|
||||
def email_unsubscribe_token(email)
|
||||
Digest::SHA2.hexdigest email+$config['email_unsubscribe_token']
|
||||
end
|
||||
|
||||
def valid_login?(username_or_email, plaintext)
|
||||
site = get_with_identifier username_or_email
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue