Hello, I have the task of making ActionMailer configurable by a user and be able to use the new configuration without the need to restart the web server. Forgive me if I am mistaken but I believe having ActionMailer configured in environment.rb will force me to restart the web service. Is there a way of making the configuration dynamic? Thanks in advance Pepe -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''m sorry, I meant ''restart the web server'' instead of ''restart the web service''. My apologies. On Dec 9, 6:06 pm, pepe <P...-1PhG29ZdMB/g+20BJ0uB2w@public.gmane.org> wrote:> Hello, > > I have the task of making ActionMailer configurable by a user and be > able to use the new configuration without the need to restart the web > server. > > Forgive me if I am mistaken but I believe having ActionMailer > configured in environment.rb will force me to restart the web service. > Is there a way of making the configuration dynamic? > > Thanks in advance > > Pepe-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You could read the desired data from a file or database and update your ActionMailer::Base.configuration before you send a mail. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Kristian. I''ve thought about this and what I would probably do is store the information for ActionMailer in a YAML file. Getting the data is not a problem, the problem is how to make ActionMailer use the changed configuration without restarting the web server. If I am not mistaken if the configuration is in environment.rb, when the web server starts it runs environment.rb and the configuration is set, in memory and will not change unless the web server (btw, I am using Mongrel only, for a very tiny in-house site) is restarted. What I would like to know is how to change the configuration so when I change the values after a user makes a change the next e-mail sent uses the new configuration without the need to restart the web server. On Dec 10, 9:37 am, Kristian Hellquist <kristian.hellqu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You could read the desired data from a file or database and update > your ActionMailer::Base.configuration before you send a mail.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2009/12/11 pepe <Pepe-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org>:> Thanks Kristian. > > I''ve thought about this and what I would probably do is store the > information for ActionMailer in a YAML file. Getting the data is not a > problem, the problem is how to make ActionMailer use the changed > configuration without restarting the web server. > > If I am not mistaken if the configuration is in environment.rb, when > the web server starts it runs environment.rb and the configuration is > set, in memory and will not change unless the web server (btw, I am > using Mongrel only, for a very tiny in-house site) is restarted. > > What I would like to know is how to change the configuration so when I > change the values after a user makes a change the next e-mail sent > uses the new configuration without the need to restart the web server.The class-methods `delivery_method'', `smtp_settings'' and `sendmail_settings'' on ActionMailer::Base can maybe help you. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Will play with it. Thanks a lot. :) On Dec 11, 2:53 am, Kristian Hellquist <kristian.hellqu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 2009/12/11 pepe <P...-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org>: > > > Thanks Kristian. > > > I''ve thought about this and what I would probably do is store the > > information for ActionMailer in a YAML file. Getting the data is not a > > problem, the problem is how to make ActionMailer use the changed > > configuration without restarting the web server. > > > If I am not mistaken if the configuration is in environment.rb, when > > the web server starts it runs environment.rb and the configuration is > > set, in memory and will not change unless the web server (btw, I am > > using Mongrel only, for a very tiny in-house site) is restarted. > > > What I would like to know is how to change the configuration so when I > > change the values after a user makes a change the next e-mail sent > > uses the new configuration without the need to restart the web server. > > The class-methods `delivery_method'', `smtp_settings'' and > `sendmail_settings'' on ActionMailer::Base can maybe help you.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Dec 10, 2009 at 2:36 AM, pepe <Pepe-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> wrote:> Hello, > > I have the task of making ActionMailer configurable by a user and be > able to use the new configuration without the need to restart the web > server. > > Forgive me if I am mistaken but I believe having ActionMailer > configured in environment.rb will force me to restart the web service. > Is there a way of making the configuration dynamic? > > Thanks in advance > > Pepe > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.