Automatic email from Rails form

22 views
Skip to first unread message

Euan Leslie

unread,
Jun 3, 2015, 4:51:10 AM6/3/15
to rubyonra...@googlegroups.com
I could have sworn I posted this yesterday but can't find it anywhere

Anyway, I am trying to get my Rails form to post an e mail to a Manager
when someone hits the 'Submit' button of my leave request form (model is
'absence').

The Manager e mail is in a field called 'mgremail' (string). Other
fields are 'name' (string), 'from (date)', 'to' (date), 'leavetype'
(string), 'comments' (text) all of which I want to include in the title
and/or body of the e mail.

I have tried to find an answer to this and have stumbled upon a couple
of potential answers, and a couple of video blogs etc, but none meet my
requirements. For example there is a Railscast about sending a
confirmation email for new users, which seems really easy until you try
to adapt it to my requirements then it falls on its face.

So, is there anyone who can help me to sort this? It's kind of doing my
head in. Thanks in advance.

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Jun 3, 2015, 6:03:02 AM6/3/15
to rubyonra...@googlegroups.com
On 3 June 2015 at 09:50, Euan Leslie <li...@ruby-forum.com> wrote:
> Anyway, I am trying to get my Rails form to post an e mail to a Manager
> when someone hits the 'Submit' button of my leave request form (model is
> 'absence').

Did you see this?
http://guides.rubyonrails.org/action_mailer_basics.html

Colin

Euan Leslie

unread,
Jun 3, 2015, 6:38:09 AM6/3/15
to rubyonra...@googlegroups.com
Colin Law wrote in post #1174468:
Jeez, how did I miss that? Maybe i should post a thread about how to
use Google properly.

Thanks, i'll get the bits I need out of there I would imagine, i'll let
you know if I have any issues.
Reply all
Reply to author
Forward
0 new messages