forked from bofh/fetsite
Mailer fuer Neuigkeiten added
This commit is contained in:
7
app/mailers/news_mailer.rb
Normal file
7
app/mailers/news_mailer.rb
Normal 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
|
||||||
4
app/views/news_mailer/neuigkeit_mail.html.erb
Normal file
4
app/views/news_mailer/neuigkeit_mail.html.erb
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<h1>
|
||||||
|
<%= @neuigkeit.title%>
|
||||||
|
</h1>
|
||||||
|
<%= raw(@neuigkeit.text) %>
|
||||||
@@ -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
|
||||||
|
|||||||
5
spec/mailers/news_mailer_spec.rb
Normal file
5
spec/mailers/news_mailer_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe NewsMailer do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user