0

I'm making a portfolio for my girlfriend to practice with rails and I have a pair of issues, first of all here is the website hosted in Heroku: https://damp-inlet-9409.herokuapp.com/

1.- When you go to "Contact", I want to send an email with the data provided there, but I don't have any idea how to do it, even looking for answers here, what people want to do is to send an email to the user after registering, so it's not the same problem

2.- When you watch the website on the phone, the font of the navbar and the title doesn't display, the font is 'Mostly Mono' and I have it with a font-face like this:

@font-face {
font-family: 'MostlyMono';
src: url('http://www.fontsaddict.com/fontface/mostly-mono.ttf'); }
Nytz
  • 37
  • 4

1 Answers1

0

First you will need to configure mailer. Follow the link: How to configure action mailer (should I register domain)?

After you configure the mailer, you will need to send the data that user entered in your contact form to one of your controller.

def contact_info
    title = params[:title]
    info = params[:info]
    email = params[:email]
    UserMailer.send_contact_info(title, info, email).deliver
end

class UserMailer < ActionMailer::Base
    default :from => DEFAULT_FROM
    def send_contact_info(title, info, email)
        @title = title
        @info = info
        mail(:to => email, :subject => "Contact info")

    end
end

After you receive this data just send it over to user mailer and access it in the HTML template.

Community
  • 1
  • 1
  • But, isn't that supposed to be sent by a user? I don't want any users to be created, and that confuses me – Nytz Dec 11 '15 at 07:58
  • Yes the mail is sent to you from your application on behalf of the user. As you do not want to create user we have not added code to save user in the controller. so to email would be your email, and the email that come from the user can be added as a contact info in email body. – sachinNadgouda Dec 11 '15 at 08:34