start on news mailer

This commit is contained in:
2023-02-11 12:07:01 +02:00
parent cee41a571e
commit b5a63df629
13 changed files with 78 additions and 5 deletions

View File

@ -1,4 +1,5 @@
class ApplicationMailer < ActionMailer::Base
default from: "info@hubfeenix.fi" , bcc: "info@hubfeenix.fi"
layout "mailer"
end

View File

@ -1,7 +1,7 @@
class FormMailer < ApplicationMailer
default from: "info@hubfeenix.fi" , bcc: "info@hubfeenix.fi"
def received(data)
def received(data )
@data = data
mail(to: data['Email'] , subject: "We have received your request")
end

View File

@ -0,0 +1,22 @@
class NewsMailer < ApplicationMailer
helper Merged::ViewHelper
def letter
@page = Merged::Page.find_by_type("blog")
mail( to: "to@example.org" )
end
def subscribed
@greeting = "Hi"
mail to: "to@example.org"
end
def unsubscribed
@greeting = "Hi"
mail to: "to@example.org"
end
end

View File

@ -2,7 +2,6 @@
%html
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/
:css
/* Email styles need to be inline */
%body
= stylesheet_link_tag "tailwind"
%body.wide
= yield

View File

@ -0,0 +1,2 @@
- @page.sections.each do |section|
= render_section( section )

View File

View File

@ -0,0 +1,4 @@
%h1= class_name + "#" + @action
%p
= @greeting + ", find me in app/views/news_mailer/subscribed.html.haml"

View File

@ -0,0 +1,3 @@
News#subscribed
= @greeting + ", find me in app/views/news_mailer/subscribed.text.haml"

View File

@ -0,0 +1,4 @@
%h1= class_name + "#" + @action
%p
= @greeting + ", find me in app/views/news_mailer/unsubscribed.html.haml"

View File

@ -0,0 +1,3 @@
News#unsubscribed
= @greeting + ", find me in app/views/news_mailer/unsubscribed.text.haml"