cartodb-4.42/app/mailers/data_observatory_mailer.rb

30 lines
845 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
class DataObservatoryMailer < ActionMailer::Base
CARTO_REQUEST_RECIPIENT = 'dataobservatory@carto.com'.freeze
EXCLUDED_ORGS = %w(team solutionscdb).freeze
default from: Cartodb.get_config(:mailer, 'from')
layout 'mail'
def user_request(user, dataset_name, provider_name)
subject = 'Your premium dataset request to CARTO'
@user_name = user.name
@dataset_name = dataset_name
@provider_name = provider_name
mail to: user.email, subject: subject
end
def carto_request(user, dataset_id, delivery_days)
subject = 'Dataset request'
@user_name = user.name
@user_email = user.email
@dataset_id = dataset_id
@delivery_days = delivery_days
unless Rails.env.staging? || EXCLUDED_ORGS.include?(user.organization&.name)
mail to: CARTO_REQUEST_RECIPIENT, subject: subject
end
end
end