Merge pull request #16354 from CartoDB/feature/sc-185564/networkrail-admin-avoid-sending-import-emails

[sc18556] Add setting to disable import emails
pull/16356/head
Shylpx 3 years ago committed by GitHub
commit 752cf40a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,6 +16,7 @@ Development
* Include DB connections, all parameters for Oauth connections, and the relationship between synchronizations and connections, in User migrations [#16287](https://github.com/CartoDB/cartodb/pull/16287)
* Upgrade to CARTO Viewer v1.0.8 [16347](https://github.com/CartoDB/cartodb/pull/16347)
* Show user's database location in profile [16349](https://github.com/CartoDB/cartodb/pull/16349)
* Setting to enable/disable import notifications [16354](https://github.com/CartoDB/cartodb/pull/16354)
### Bug fixes / enhancements
- Add marginTop to Page when notification is displayed [#16355](https://github.com/CartoDB/cartodb/pull/16355)

@ -7,7 +7,8 @@ module Carto
validate :valid_notification
NOTIFICATION_DO_SUBSCRIPTIONS = 'do_subscriptions'.freeze
VALID_NOTIFICATIONS = [NOTIFICATION_DO_SUBSCRIPTIONS].freeze
NOTIFICATION_IMPORTS = 'imports'.freeze
VALID_NOTIFICATIONS = [NOTIFICATION_DO_SUBSCRIPTIONS, NOTIFICATION_IMPORTS].freeze
def self.new_do_subscriptions(user_id)
Carto::UserEmailNotification.create!(

@ -92,7 +92,8 @@
"notifications": {
"enabled": "On",
"disabled": "Off",
"do_subscriptions":"Emails from Data Observatory"
"do_subscriptions": "Emails from Data Observatory",
"imports": "Emails from Imports"
}
}
}

@ -191,6 +191,8 @@ module Resque
def self.perform(user_id, imported_tables, total_tables, first_imported_table, first_table, errors, filenames)
u = ::User.where(id: user_id).first
return unless u.carto_user.email_notification_enabled?(Carto::UserEmailNotification::NOTIFICATION_IMPORTS)
ImportMailer.data_import_finished(u, imported_tables, total_tables, first_imported_table, first_table, errors,
filenames).deliver_now
end

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "cartodb-ui",
"version": "1.0.0-assets.265",
"version": "1.0.0-assets.268",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "cartodb-ui",
"version": "1.0.0-assets.267",
"version": "1.0.0-assets.268",
"description": "CARTO UI frontend",
"repository": {
"type": "git",

Loading…
Cancel
Save