class EmailController < ApplicationController
include ProfileHelper
before_filter :protect, :only => [ "correspond" ]
def remind
@title = "Mail me my login information"
if param_posted?(:user)
email = params[:user][:email]
user = User.find_by_email(email)
if user
UserMailer.deliver_reminder(user)
flash[:notice] = "Login information was sent."
redirect_to :action => "index", :controller => "site"
else
flash[:notice] = "There is no user with that email address."
end
end
end
def email_sent
MyMailer::deliver_mail("[email protected]")
end
def correspond
user = User.find(session[:user_id])
id=session[:user_id]
Personal.find_each do |@per|
if(@per.user_id == id) # id is user id
@per_id = "#[email protected]}" #que_id is question_id
break
end
end
i...@per_id
#flash[:notice] = idd
iddd=idd.to_i
recipient = User.find_by_user_name(params[:id])
@title = "Email: #[email protected]_name} #[email protected]_name}
(#{user.user_name}) :: Recipient: #{recipient.user_name}"
if param_posted?(:message)
@message = Message.new(params[:message])
if @message.valid?
UserMailer.deliver_message(
:user => user,
:recipient => recipient,
:message => @message,
:user_url => profile_for(user),
:reply_url => url_for(:action => "correspond",
:id => user.user_name)
)
flash[:notice] = "Email sent."
redirect_to profile_for(recipient)
end
end
end
end
ya diz is the code for email_controller....
Can u please tell me what is the problem that the email is not being
sent?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.