Commit Graph

22 Commits

Author SHA1 Message Date
Arpit Jalan eb9155f3fe
FEATURE: send max 200 emails every minute for bulk invites (#7875)
DEV: deprecate `invite.via_email` in favor of `invite.emailed_status`

This commit adds a new column `emailed_status` in `invites` table for
 tracking email sending status.
 0 - not required
 1 - pending
 2 - bulk pending
 3 - sending
 4 - sent

For normal email invites, invite record is created with emailed_status
 set to 'pending'.

When bulk invites are sent invite record is created with emailed_status
 set to 'bulk pending'.

For invites that generates link, invite record is created with
 emailed_status set to 'not required'.

When invite email is in queue emailed_status is updated to 'sending'

Once the email is sent via `InviteEmail` job the invite emailed_status
 is updated to 'sent'.
2019-07-19 11:29:12 +05:30
Arpit Jalan e7fe7010b8
FIX: use hijack for processing bulk invites (#7679)
FIX: do not store bulk invite CSV file on server
2019-06-04 20:19:46 +05:30
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
Guo Xiang Tan d6e45864ce Fix failing spec. 2019-04-16 09:59:35 +08:00
Guo Xiang Tan ce4c8e957b PERF: Avoid looking up the same group multiple times during bulk invite.
Also cache the guardian check because it does a query to check if the
user is an owner of the group.
2019-04-16 09:42:25 +08:00
Guo Xiang Tan 25514550f0 FIX: Bulk invite should skip invite and add existing users to groups. 2019-04-16 09:42:25 +08:00
Guo Xiang Tan 6e6cdfaf80 FIX: Bulk invite should not add users to automatic groups.
* Also checks that the user creating the bulk invite has permission.
2019-04-16 09:42:25 +08:00
Arpit Jalan f87b35e6f4 FIX: do not raise exception if the file is missing 2019-04-04 15:36:51 +05:30
Guo Xiang Tan 4f81d4cc8e Minor fixes to `Jobs::BulkInvite`. 2018-08-30 15:35:16 +08:00
Guo Xiang Tan 142571bba0 Remove use of `rescue nil`.
* `rescue nil` is a really bad pattern to use in our code base.
  We should rescue errors that we expect the code to throw and
  not rescue everything because we're unsure of what errors the
  code would throw. This would reduce the amount of pain we face
  when debugging why something isn't working as expexted. I've
  been bitten countless of times by errors being swallowed as a
  result during debugging sessions.
2018-04-02 13:52:51 +08:00
Jan Suchal bc56d86a63 Support ruby 2.5.0 2018-01-09 16:03:17 +01:00
Arpit Jalan e6e0025326 FIX: handle BOM in bulk import CSV file 2017-05-09 22:38:07 +05:30
Arpit Jalan 94683b33b8 FIX: sanitize bulk invite error log 2017-05-09 17:41:59 +05:30
Arpit Jalan ce974da9e5 FIX: simplify CSV file upload 2016-12-05 14:09:08 +05:30
Arpit Jalan e5a13b0ac1 FIX: specify CSV file encoding and better error reporting 2016-10-18 00:31:35 +05:30
Arpit Jalan 430967c354 FIX: invite email should be verified against email_domains_blacklist 2014-10-09 20:21:01 +05:30
Arpit Jalan aeec5067d5 FEATURE: Send notification by system user for bulk invite 2014-07-02 14:28:57 +05:30
Arpit Jalan dad2d34d02 Refactor methods post feedback 2014-06-26 22:50:09 +05:30
Arpit Jalan 52f9984804 FEATURE: Add topic invitation support to Bulk Invite 2014-06-26 20:46:53 +05:30
Arpit Jalan b227f736f1 Refactor code and update specs 2014-06-26 01:34:26 +05:30
Arpit Jalan c2055732c7 FEATURE: Add groups support to Bulk Invite 2014-06-26 00:15:26 +05:30
Arpit Jalan 727184641e FEATURE: Bulk Invite 2014-06-09 01:43:39 +05:30