app/models/surveys/survey_notification.rb
# This should return something falsey if no email was sent, and something
# truthy if an email was sent. SurveyUpdate relies on this behavior.
This should return something falsey if no email was sent, and something
truthy if an email was sent. SurveyUpdate relies on this behavior.
This should return something falsey if no email was sent and something truthy if an email was sent . SurveyUpdate relies on this behavior .
def send_email
    return if %w[development staging].include?(Rails.env) && !ENV['survey_test_email']
              .split(',').include?(user.email)
    return if email_sent_at.present?
    return if user.email.nil?
    SurveyMailer.send_notification(self)
    update_attribute(:email_sent_at, Time.zone.now)
  end
def send_email return if %w[ development staging ] . include? ( Rails . env ) && ! ENV [ 'survey_test_email' ] . split ( ',' ) . include? ( user . email ) return if email_sent_at . present? return if user . email . nil? SurveyMailer . send_notification ( self ) update_attribute ( :email_sent_at , Time . zone . now ) end
This should return something falsey if no email was sent, and something
truthy if an email was sent.
This should return something falsey if no email was sent and something truthy if an email was sent .
# In these environments only send emails to the users specified in ENV['survey_test_email']