I want to notify the user by email when an action occurs using ActionMailer.
However, under the current situation, the following error will be displayed and the mail will not be sent correctly.
As it is written below, if you hit the address solidly, an email will be sent.
By the way, I implemented it with reference to this area.
I would appreciate it if you could tell me the solution including the cause of the error.Corresponding source code
What I tried
##/mailers/target_mailer.rb class TargetMailer</pre> <pre><code>## idealweight_controller class IdealweightsController</pre> <pre><code>##/views/target_mailer/input_information.text.erb Your registration is complete <!-Content is appropriate->
If i solidify the user's address, an email will be sent without any error.
Supplementary information (FW/tool version, etc.)
Answer # 1
I have created an email column in the user model, but I have not created it in this ideal weight model.
@ idealweight.emailI don't think it can be done,
`@idealweightSince the user_id column exists in, if it is linked with model
@ idealweight.user.emailI feel that I can get the email I expected at. In other words, how about the following?
mail (subject: "You have registered a goal", to: @ idealweight.user.email)
- ruby on rails 5 - star evaluation using raty stars become very large
- i want to keep data consistent using [ruby on rails] transaction and payjp
- ruby on rails - about deploying apps using s3 function
- [ruby on rails 6] i implemented the tag function using acts-as-taggable-on, but i can't jump to the linked article from the list
- ruby on rails - no data when using v-if
- ruby on rails - i can't comment out using htmlerb begin
- ruby - [rails] i want to find the date difference using the model created_at
- ruby - i want to get it at intervals by searching using rails active record
- ruby - i want to solve the n + 1 problem when using rails where method in loop processing
- ruby on rails - [rails 6] i'm using bootstrap 4, but the layout collapses only after logging out
- ruby on rails - extract multiple specific columns from one activerecord and make them json
- ruby - i want to display specific columns in rails in descending order of numbers
- ruby - [rails] i want to deploy a rails application using elastic beanstalk
- ruby - i want to collect the same records using rails group and get the value
- ruby on rails - the graph is not displayed well in the app using rails a 0 will be entered in the date when no data is entered,
- ruby - about routing using rails collection
- ruby on rails - [rails] i want to define routing using the resources method
- ruby - [rails] i want to create an image link using the url of the image output using active storage
- ruby on rails - i'm using payjpjs v2 i want to register the card name
- ruby - passing variables using render partial
- how to embed code in ruby on rails
- ruby - when deploying on capistrano, i get the error "access denied for user'ec2-user' @'localhost' (using password: no)&qu
- how to reflect the layout downloaded from the external site in ruby on rails?
- ruby - how nice! function routes do not pass well (relation) [rails]
- [ruby/rails] when you want to replace in a specific character string
- ruby - about associations with 4 models
- ruby - [rails] page transition is not correct after deploying heroku (we're sorry, but something went wrong)
- ruby - deployment error on heroku