开发者

My site name and url are not recognized from my mailers

开发者 https://www.devze.com 2022-12-16 00:13 出处:网络
I\'m new at ruby on rails, and I\'ve noticed that when I send an email, my site_name and site_url vars are not being recognized from the mailer files.

I'm new at ruby on rails, and I've noticed that when I send an email, my site_name and site_url vars are not being recognized from the mailer files.

In my config.yml file I've got the following:

development: &local
    site_name: my site name
    site_url: http://localhost:8282

    company_name: my company name
    admin_email: admin@domain.com

    support_name: askdjaskd Support
    support_email: support@domain.com

production:
  <<: *local

staging:开发者_StackOverflow中文版
  <<: *local

test:
  <<: *local

And in the mailers I call them the as follows:

@body[:url]  = "http://#{Setting.get(:site_url)}/"

Do I need to write a require statement at the beginning of the mailers? If not, what am I missing?

Thanks, Brian


I've solved it! Instead of Settings.get(:site_url), I'm using configatron.site_url and it works!

Thank you!

Brian

0

精彩评论

暂无评论...
验证码 换一张
取 消