Open iamraffe opened 8 years ago
Just tested this with a Rails 5 app, not seeing any issues here.
I can confirm, I am also seeing this issue
Seeing the same error myself. I'm running ubuntu 14.04 on digitalocean. rails 4.2.6 and mailgun_rails 0.8.0.
So no developpers came here to say anything? Could you solve your problem?
@ArielAleksandrus no response from the maintainers so far. I'm quite new to rails and have no idea even where to start looking at. otherwise, I would be happy to submit a PR with a fix.
I'm seeing this with Rails 5 on Heroku. The problem is that RestClient offers NOTHING to help debug this. It simply prints RestClient::ResourceNotFound (404 Resource Not Found):
to the logs and then…nothing
PR to log specific error response from mailgun: https://github.com/jorgemanrubia/mailgun_rails/pull/67
Also experiencing this issue with Rails 4.2.3 on Heroku.
@garybunofsky could you confirm that your Mailgun config is setup correctly?
As far as I know it is. I have mailgun_api_key
, mailgun_domain
and mailgun_sender
set in my secrets.yml
. My production.rb has the following to override actionmailer:
config.action_mailer.delivery_method = :mailgun config.action_mailer.mailgun_settings = { api_key: Rails.application.secrets.mailgun_api_key, domain: Rails.application.secrets.mailgun_domain }
Is any of that improper? Could having gem 'mailgun-ruby', '1.1.0', require: 'mailgun'
and gem 'mailgun_rails'
in my Gemfile be the issue?
Hmm, my stack is deployed via Chef (AWS OpsWorks) and I template those setting via env vars, here's an example: - this keeps the keys outside the code-base (and git tracking), which is very important!
# production.rb
config.action_mailer.delivery_method = :mailgun
config.action_mailer.mailgun_settings = {
api_key: ENV['MAILGUN_API_KEY'],
domain: ENV['MAILGUN_DOMAIN']
}
As an aside, here's my secrets.yml
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
My Gemfile.lock
shows mailgun_rails (0.8.0)
and the Gemfile
just has gem 'mailgun_rails'
.
I'd suggest as a starting point, drop into a console in production and test to see what Rails.application.secrets.mailgun_api_key
and mailgun_domain
give you.
Then, try forcing v0.8.0, and see if that does anything differently.
So far, mailgun is working find here, latest Rails 5 app too.
Thanks @bsodmike. I did what you suggested and used environment variables instead of Rails.application.secrets
. I'm no longer getting the RestClient::ResourceNotFound (404 Resource Not Found):
error. I appreciate your help.
For anyone else experiencing this issue and using using devise, make sure your devise.rb
has the proper sender. e.g.
config.mailer_sender = ENV["MAILGUN_SENDER"]
Fantastic, thanks! :metal:
I had to use the following ENV variables to get mine to work:
config.action_mailer.mailgun_settings = {
api_key: ENV["MAILGUN_API_KEY"],
domain: ENV["MAILGUN_DOMAIN"],
user_name: ENV["MAILGUN_SMTP_LOGIN"],
password: ENV["MAILGUN_SMTP_PASSWORD"]
}
@naterexw errr I don't see user_name
or password
here https://github.com/jorgemanrubia/mailgun_rails/blob/master/lib/mailgun_rails/client.rb#L8-L12 so those are not doing much 😝
Thanks @bsodmike. I did what you suggested and used environment variables instead of
Rails.application.secrets
. I'm no longer getting theRestClient::ResourceNotFound (404 Resource Not Found):
error. I appreciate your help.For anyone else experiencing this issue and using using devise, make sure your
devise.rb
has the proper sender. e.g.config.mailer_sender = ENV["MAILGUN_SENDER"]
whats meant by MAILGUN_SENDER here? like mailgun or domain?
@Faisal-nfl it'll be the default reply mail address such as "noreply@mydomain.com"
I have deployed my app to Digital Ocean and while it seems to work correctly in development, in production I keep getting that message.
Any ideas as to why that might be happening?
I should also mention, this is happening with Devise, upon confirming the account.