Forum: Ruby on Rails Automatic email from Rails form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
682eeec3e38fe0f8ec5b6b801f420dc6?d=identicon&s=25 Euan Leslie (euan)
on 2015-06-03 10:50
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.
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2015-06-03 12:03
(Received via mailing list)
On 3 June 2015 at 09:50, Euan Leslie <lists@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
682eeec3e38fe0f8ec5b6b801f420dc6?d=identicon&s=25 Euan Leslie (euan)
on 2015-06-03 12:37
Colin Law wrote in post #1174468:
> On 3 June 2015 at 09:50, Euan Leslie <lists@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



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.
This topic is locked and can not be replied to.