added mailer
This commit is contained in:
@@ -8,6 +8,7 @@ class SupportersController < ApplicationController
|
||||
def create
|
||||
@supporter = Supporter.new supporter_form_params.merge(language: I18n.locale)
|
||||
if !input_to_fast? && @supporter.save
|
||||
SupporterMailer.welcome_email(@supporter).deliver_now
|
||||
redirect_to thanks_path
|
||||
else
|
||||
flash.now[:danger] = t '.timeout' if input_to_fast?
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: 'markus@hanflegal.ch'
|
||||
layout 'mailer'
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class SupporterMailer < ApplicationMailer
|
||||
def welcome_email(supporter)
|
||||
@supporter = supporter
|
||||
mail(to: @supporter.email, subject: I18n.t('welcome_email.subject'))
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
meta content=("text/html; charset=UTF-8") http-equiv="Content-Type" /
|
||||
body style='padding: 20px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;'
|
||||
= yield
|
||||
@@ -0,0 +1,20 @@
|
||||
p
|
||||
strong Hallo #{@supporter.first_name},
|
||||
|
||||
p Du bist nun ein Teil der Bewegung!
|
||||
|
||||
p Wir informieren dich per E-Mail über die nächsten Schritte und kommen aktiv auf dich zu. Auf <a href="https://www.hanflegal.ch/initiative">https://www.hanflegal.ch/initiative</a> informieren wir über laufende Aktivitäten.
|
||||
|
||||
p
|
||||
b Was kannst du machen?
|
||||
|
||||
p
|
||||
ul
|
||||
li Folge uns auf Facebook <a href="https://www.facebook.com/vereinlegalizeit">Facebook</a> und <a href="https://twitter.com/VereinLegalize">Twitter</a>
|
||||
li Teile unser Projekt in den sozialen Medien mit dem Hashtag #ch420
|
||||
li Erzähle allen von unserem Vorhaben und bitte Sie mitzumachen
|
||||
li Werde Mitglied beim <a href="https://www.hanflegal.ch">Verein Legalize it!</a>
|
||||
|
||||
p
|
||||
| Hanfige Grüsse,
|
||||
em die Initianten
|
||||
Reference in New Issue
Block a user