我正在为我的女朋友制作一个组合来练习 Rails,我有两个问题,首先是在 Heroku 中托管的网站:https://damp-inlet-9409.herokuapp.com/
1.- 当你去“联系”时,我想用那里提供的数据发送一封电子邮件,但我不知道该怎么做,甚至在这里寻找答案,人们想做什么就是注册后给用户发邮件,所以不是同一个问题
2.- 当你在手机上看网站时,导航栏和标题的字体不显示,字体是“MoSTLy Mono”,我有这样的字体:
@font-face {
font-family: 'MostlyMono';
src: url('http://www.fontsaddict.com/fontface/mostly-mono.ttf'); }
最佳答案
首先您需要配置邮件程序。 点击链接: How to configure action mailer (should I register domain)?
配置邮件程序后,您需要将用户在您的联系表单中输入的数据发送到您的 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
收到此数据后,只需将其发送给用户邮件程序并在 HTML 模板中访问即可。
关于css - 发送电子邮件 rails 和字体不显示电话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34217178/