Forum: Ruby on Rails Rails + Scaffold + Send Emails

E792be7c07744f730c1758eacc89908b?d=identicon&s=25 HelloRails (Guest)
on 2011-04-01 14:30
(Received via mailing list)
Hi!

I have scaffold named `users` with fields: `email, surname.`

I inserted about `10 users.`

Bottom of the scaffold there are button called `"Send"`.

When i pressed this button email receive all 10 people with following
text => `"Hello! my number is 718927 (this is generated by rand(9999)
for example)."`

How can i do it? Can i do it ?

I should have in questions_controller:

def button_send

end


or what ? or through actionmailer? Idont understand the logic as well
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2011-04-01 15:37
(Received via mailing list)
On Apr 1, 1:29pm, HelloRails <vitalizakhar...@gmail.com> wrote:
> for example)."`
>
> How can i do it? Can i do it ?
>
> I should have in questions_controller:
>
> def button_send
>
> end
>
> or what ? or through actionmailer? Idont understand the logic as well

You will indeed be using actionmailer to do the actualy sending of
emails - I'd start with the actionmailer guide at
guides.rubyonrails.org. Then you'll need to add an action to your
controller that calls the mailer you've just created

Fred
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.