Home>
I do not understand the email sending settings for DEVISE. I would be grateful if anyone came to know this.
Environment
ruby 2.5.1
rails 6.0.3.2
devise 4.7.2
mac catalina 10.15.5
https://localhost:9292/
If i press send me reset password from the devise forgot your password page
ArgumentError in Devise::Passwords#create
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
And the err message appears.
So, register for sendgrid (English)
config>environments>development.rb
Add the following to
config.action_mailer.default_url_options = {host: ENV['SG_WEB_HOST'], protocol: ENV['SG_WEB_PROTOCOL']}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :https
config.action_mailer.https_settings = {
:address =>ENV['SG_SMTP_ADDRESS'],
:domain =>ENV['SG_DOMAIN'],
:port =>ENV['SG_PORT'],
:user_name =>ENV['SG_USER_NAME'],
:password =>ENV['SENDGRID_API_KEY'],
:authentication =>'login',
:enable_starttls_auto =>true
Add the following to .zshrc
SENDGRID_API_KEY is private.
SG_SMTP_ADDRESS,SG_DOMAIN
Does not know what to write.
export SG_USER_NAME='apikkey'
export SENDGRID_API_KEY=''
export SG_WEB_HOST='api.sendgrid.com'
export SG_WEB_PROTOCOL='HTTPS'
export SG_SMTP_ADDRESS=''
export SG_DOMAIN=''
export SG_PORT='TCP 443'
I investigated and tried it for about 6 hours, but it did not solve it.
If anyone knows, we would appreciate it if you could answer.
Thanks for your cooperation.
-
Answer # 1
Related articles
- ruby - [rails] implementation of sending registration completion email
- [ruby] i don't understand the meaning of the error statement
- ruby on rails 5 - i do not understand the meaning of self in the model
- ruby on rails 5 - i don't understand the difference between signup_path and new_user_path
- ruby on rails 5 - i do not understand the code that returns the hash value of the passed string
- ruby on rails - can't send devise email authentication email with rails app on heroku
- ruby on rails 5 - i don't understand why i create a virtual attribute
- network - [twice nat] i don't understand the yamaha settings
- ruby - when confirming an email using confirmation with rails, an email arrives in the format http://localhost:3000/~
- ruby on rails - about column settings you want to add with devise_parameter_sanitizer of devise using multiple models
- i get an error when sending an email on heroku
- ruby - i can't add sendgrid to heroku so i can't use devise's email function
- [ruby] i can't understand iterative processing using each
- i want to create an email sending function, but the file does not come out even after vim and command operations m (__) m
- ruby on rails - i don't understand the description of the form object pattern
- ruby - the production environment settings do not work
- [ruby] "attr_accessor" i don't understand this method
- ruby - are the environment variable settings set correctly? [payjp]
- ruby - [rails 5] i want to send an email to a specific user using action mailer
Related questions
- ruby - rails6 active_strage cannot be installed
- ruby - i want to resolve the error statement "/ users/sign_up" in devise's no route matches [post]
- ruby - gem devise (top page (login form input)) → list screen
- ruby - how to give edit permissions only to rails contributors
- ruby - i want to be able to see "liked posts" by the person on the rails development user detail page
- ruby - [rails] i can't start unicorn
- Rails ActiveAdmin can not login
- ruby - destroy action does not respond
- ruby - dynamic form implementation in nested_form
- javascript - questions about the open method for asynchronous communication
So, for the moment, I think it is desirable to check the mail transmission with letter_opener, letter_opener_web.
Reference: Check the email sent from rails during development
Other than SendGrid, you can also send by Gmail, for example.