i have a rails model registrations
that has the following fields
attr_accessible :address, :company, :name, :phone, :email
i have successfully been able to send a mail to the user via the email fielded in by the user and that works succesfully using action mailer
def create
@registration = Registration.new(params[:registration])
respond_to do |format|
if @registration.save
UserMailer.registration_confirmation(@registration).deliver
format.html { redirect_to root_path, notice:" Thanks! #{@registration.name}, Your registration have been
confirmed & your seat reserved" }
format.json { render :show, status: :created, location: @registration }
else
format.html { render action: "new" }
format.json { render json: @registration.errors, status: :unprocessable_entity }
end
end
end
and the registration mailer is as thus
def registration_confirmation(registration)
@registration = registration
@greeting = "Hi"
mail(to: @registration.email, subject: 'Welcome')
end
which works very well...
All i want to achieve is to be able to send a mail to another email address e.g (admin@gmail.com) stating that a user as registered and also showing the registration details ... thanks