Mailer fuer Neuigkeiten added

This commit is contained in:
2014-07-02 12:06:11 +02:00
parent 38716d7a58
commit d72ece824c
4 changed files with 20 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
class NewsMailer < ActionMailer::Base
default from: "salzamt@fet.at"
def neuigkeit_mail(email, neuigkeit_id)
@neuigkeit= Neuigkeit.find(neuigkeit_id)
mail(to: "andis@fet.at", subject: @neuigkeit.title)
end
end

View File

@@ -0,0 +1,4 @@
<h1>
<%= @neuigkeit.title%>
</h1>
<%= raw(@neuigkeit.text) %>

View File

@@ -14,7 +14,8 @@ Fetsite::Application.configure do
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
# Don't care if the mailer can't send # Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method =:sendmail
config.action_mailer.default_url_options = {} # :host => 'glonass.htu.tuwien.ac.at' } config.action_mailer.default_url_options = {} # :host => 'glonass.htu.tuwien.ac.at' }
# Print deprecation notices to the Rails logger # Print deprecation notices to the Rails logger
config.active_support.deprecation = :log config.active_support.deprecation = :log
@@ -33,5 +34,5 @@ config.action_mailer.default_url_options = {} # :host => 'glonass.htu.tuwien.ac
config.assets.compress = false config.assets.compress = false
# Expands the lines which load the assets # Expands the lines which load the assets
config.assets.debug = true config.assets.debug = false
end end

View File

@@ -0,0 +1,5 @@
require "spec_helper"
describe NewsMailer do
pending "add some examples to (or delete) #{__FILE__}"
end