I created an instance variable (@user) in the mailer model and want to access it in the view? But this gives me an error (@user = nil). What is the best way to pass a variable to view (email body)?
Thanks Chirag
If you want to access the instance variable in the mailer template, add in your mailer model
@body[:user] = user_object
@user, .
@user
, (text/html).
I Rails 3 :
@user = user_object
,
mail(:from => "info@domain.info", :to => recipient, :subject => "Subject")
view/email, body:-) , ,, body :account => recipient @account recipient, .
body :account => recipient
@account
recipient
Source: https://habr.com/ru/post/1729663/More articles:Shorten a string using the body "..." - stringПолучить охватывающий класс, затем получить доступ к его свойствам внутри настраиваемого атрибута - c#horn iphone "ping" - iphonehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1729661/dealing-with-high-number-of-real-time-calls-to-partner-api-in-rails&usg=ALkJrhj6RGXTl9BUWFmC8cI0_CF21Z6sNghttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1729662/what-are-some-pythonic-ways-to-share-variables-with-objects-defined-in-a-module&usg=ALkJrhi1aFiUShj87bCUjiM5mn6DIuoPMQHow to access the entire list of ringtones on an Android phone? - androidLines in the text field SSRS VS05 - reportingservices-2005использовать wmi для получения новейших событий журнала Windows - wmihttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1729667/sql-server-takes-too-long-time-for-update-query-to-execute-for-few-rows&usg=ALkJrhhfeSkr00RIqO2qWwxAdHJsymfunQHow to specify a timeout value in HttpWebRequest.BeginGetResponse without blocking the stream - asynchronousAll Articles