Commit Graph

27 Commits

Author SHA1 Message Date
evazion
e40218d1c8 Fix #4515: Set List-Unsubscribe header on notification emails. 2022-01-02 17:10:27 -06:00
evazion
50fa674a3e pundit: convert emails to pundit. 2020-03-20 18:03:01 -05:00
evazion
0ef9d6e417 emails: send welcome mail on signup. 2020-03-14 19:18:28 -05:00
evazion
d860fab7f5 emails: send verification mail when user changes address. 2020-03-14 18:32:00 -05:00
evazion
5625458f69 users: refactor password reset flow.
The old password reset flow:

* User requests a password reset.
* Danbooru generates a password reset nonce.
* Danbooru emails user a password reset confirmation link.
* User follows link to password reset confirmation page.
* The link contains a nonce authenticating the user.
* User confirms password reset.
* Danbooru resets user's password to a random string.
* Danbooru emails user their new password in plaintext.

The new password reset flow:

* User requests a password reset.
* Danbooru emails user a password reset link.
* User follows link to password edit page.
* The link contains a signed_user_id param authenticating the user.
* User changes their own password.
2020-03-08 23:18:15 -05:00
evazion
13528ac2d3 Drop forum subscriptions.
Few people used forum subscriptions (only around 100), and even fewer
people were subscribed to active threads. Most subscriptions were for
old threads that will never be bumped again. The implementation also had
a few problems:

* Unsubscribe links in emails didn't work (they unset the user's
  receive_email_notifications flag, but forum subscriptions didn't
  respect this flag).
* Some users had invalid email addresses, which caused notifications to
  bounce. There was no mechanism for preventing bounces.
* The implementation wasn't scalable. It involved a daily linear scan
  over _all_ forum subscriptions looking for any topics that had been updated.
2020-01-21 00:10:21 -06:00
evazion
59b277ead1 users: drop id_to_name, name_to_id caching.
Changes:

* Drop Users.id_to_name.
* Don't cache Users.name_to_id.
* Replace calls to name_to_id with find_by_name when possible.
* Don't autodefine creator_name in belongs_to_creator.
* Don't autodefine updater_name in belongs_to_updater.
* Instead manually define creator_name / updater_name only on models that need
  to return these fields in the api.

id_to_name was cached to reduce the impact of N+1 query patterns in
certain places, especially in api responses that return creator_name /
updater_name fields. But it still meant we were doing N calls to
memcache. Using `includes` to prefetch users avoids this N+1 pattern.

name_to_id had no need be cached, it was never used in any performance-
sensitive contexts.

Avoiding caching also avoids the need to keep these caches consistent.
2019-08-18 11:24:42 -05:00
evazion
0c6d9f60bd Remove unused mailers. 2019-08-06 10:42:45 -05:00
evazion
604bfb0923 Fix #3846: Subscribed forum posts link to invalid URL in email updates.
Test: http://localhost/rails/mailers/user_mailer/forum_notice
2018-08-27 22:04:37 -05:00
Albert Yi
664a3f02e2 fixes for failed cron maintenance tasks
* update rails scripts for 5.2
* system dmails should be scoped to system
* fix broken url generator in forum notices
2018-04-27 15:01:40 -07:00
evazion
7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion
17d4feaf15 dmail_notice.html.erb: use absolute urls in dtext links. 2017-02-18 03:11:35 -06:00
Albert Yi
87bcc07fae enable ragel parser for remaining dtext endpoints 2017-01-10 15:12:37 -08:00
r888888888
4c5e7a2708 fixes #2478: Add links for easy opt-out of emails 2015-09-03 17:03:03 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
652db511ac better formatting for forum update emails 2015-02-15 13:03:46 -08:00
r888888888
2b96040a30 fixes #2191 2014-08-12 17:03:16 -07:00
r888888888
74aecae694 fix dmail test 2014-02-03 12:56:55 -08:00
Toks
d49571226c #2093: Parse dtext 2014-01-22 20:06:05 -05:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
albert
bf44bbb112 fixes #702 2013-03-02 22:22:57 -05:00
albert
aea7f938b8 style fixes 2012-09-21 16:34:21 -04:00
albert
4baf5be7a2 added upgrade mailer 2011-12-02 16:46:37 -05:00
albert
1e9efe65f4 updated mailer urls 2011-09-18 17:12:48 -04:00
albert
90a41a334b separated pool/post updates; fixed unit tests 2011-03-13 17:49:34 -04:00
albert
9e7efbd295 stubbed in view code from old danbooru; only janitors can lock a wiki page 2011-02-28 14:18:39 -05:00
albert
0bb52fd63a added dmail test 2010-02-20 18:08:22 -05:00