form mailer

This commit is contained in:
2023-02-09 12:49:33 +02:00
parent 454a3de3f2
commit a04c860354
8 changed files with 74 additions and 6 deletions

View File

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

View File

@ -0,0 +1,8 @@
class FormMailer < ApplicationMailer
default from: "info@hubfeenix.fi" , bcc: "info@hubfeenix.fi"
def received(data)
@data = data
mail(subject: "We have received your request")
end
end

View File

@ -0,0 +1,21 @@
%h1 Hello
= @data["name"]
%p
This is an automated message confirming that we have receievd your request
%p
Your form input is listed below. If you need to amend or correct, you may reply
to this email.
%p
You will hear from us in the next few days
%p
Your friendly Feenix Bot
%h3 Data received
- @data.each do |name , value|
%p
= "#{name}: #{value}"

View File

@ -0,0 +1,17 @@
="Hello #{@data['name']}"
This is an automated message confirming that we have receievd your request
Your form input is listed below. If you need to amend or correct, you may reply
to this email.
You will hear from us in the next few days
Your friendly Feenix Bot
Data received
-------------
- @data.each do |name , value|
= "#{name}: #{value}"