Forum: Ruby on Rails help with sending email 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.
Frank (Guest)
on 2005-12-21 20:57
(Received via mailing list)
Hello,

I have an email app running where I can send an email.
How do I pass form data to my email notifier?

here is my code that is not working.

<%= start_form_tag :action => "index" %>

<% if @flash['notice'] %>

<div class="Message"><%= @flash['notice'] %></div>

<% end %>

<p>

Please enter your email address:

</p>

<%= text_field "post", "email", :size => 20, :value => @email,
:class=>"form" %><br /><br />

<input type="submit" value="Resend &#187;" />



<%= end_form_tag %>

***********************************************************

class IndexController < ApplicationController

def index

@p = params[:index]

Notifier::deliver_signup_thanks(@p)

end

end

***********************************************************

class Notifier < ActionMailer::Base

def signup_thanks(p)

# Email header info MUST be added here

@recipients = "removed_email_address@domain.invalid"

@from = "removed_email_address@domain.invalid"

@subject = "Thank you for registering with our website"

# Email body substitutions go here

@body = p.email

end

end
This topic is locked and can not be replied to.