Glsamaker::Mail

Public Instance Methods

approval_notification(glsa) click to toggle source
# File lib/glsamaker/mail.rb, line 59
def approval_notification(glsa)
  if GLSAMAKER_NO_EMAIL
    Rails.logger.info "Not sending email."
    return false
  end

  rcpt = glsa.submitter
  return unless rcpt.can_access? glsa

  unless rcpt.get_pref_category(:mail)[:comment] == false
    GlsaMailer.approval(rcpt, glsa).deliver
  end
end
comment_notification(glsa, comment, user) click to toggle source
# File lib/glsamaker/mail.rb, line 44
def comment_notification(glsa, comment, user)
  if GLSAMAKER_NO_EMAIL
    Rails.logger.info "Not sending email."
    return false
  end

  rcpt = glsa.submitter
  return unless rcpt.can_access? glsa
  return if rcpt == user

  unless rcpt.get_pref_category(:mail)[:comment] == false
    GlsaMailer.comment(rcpt, glsa, comment, user).deliver
  end
end
edit_notification(glsa, diff, user) click to toggle source
# File lib/glsamaker/mail.rb, line 14
def edit_notification(glsa, diff, user)
  if GLSAMAKER_NO_EMAIL
    Rails.logger.info "Not sending email."
    return false
  end
  
  User.find(:all, :conditions => 'id > 0').each do |rcpt|
    next unless rcpt.can_access? glsa
    
    unless rcpt.get_pref_category(:mail)[:edit] == false
      GlsaMailer.edit(rcpt, glsa, diff, user).deliver
    end
  end
end
request_notification(glsa, user) click to toggle source
# File lib/glsamaker/mail.rb, line 29
def request_notification(glsa, user)
  if GLSAMAKER_NO_EMAIL
    Rails.logger.info "Not sending email."
    return false
  end
  
  User.find(:all, :conditions => 'id > 0').each do |rcpt|
    next unless rcpt.can_access? glsa        
    
    unless rcpt.get_pref_category(:mail)[:request] == false
      GlsaMailer.new_request(rcpt, glsa, user).deliver
    end
  end
end
send_text(text, subject, user, footer = true) click to toggle source
# File lib/glsamaker/mail.rb, line 73
def send_text(text, subject, user, footer = true)
  if GLSAMAKER_NO_EMAIL
    Rails.logger.info "Not sending email."
    return false
  end

  GlsaMailer.deliver_text(user, subject, text, footer)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.