Class MailSpecificationController
In: app/controllers/mail_specification_controller.rb
Parent: ApplicationController

Methods

Public Instance methods

Method is used to edit the sendmail settings and renders the sendmail form.

[Source]

    # File app/controllers/mail_specification_controller.rb, line 53
53:   def edit_sendmail
54:     @sendmail_old = params[:sendmail]
55:     render :partial => "sendmail_form"
56:   end

Method is used to edit the smtp settings and renders the smtp form.

[Source]

    # File app/controllers/mail_specification_controller.rb, line 47
47:   def edit_smtp
48:     @smtp_old = params[:smtp]
49:     render :partial => "smtp_form"
50:   end

Method is used to save the sendmail settings.

[Source]

    # File app/controllers/mail_specification_controller.rb, line 59
59:   def save_sendmail_settings
60:     str = ""
61:     str = check_for_sendmail_validations(params[:sendmail])
62:     if str.length < 1
63:       data = Hash['location' => params[:sendmail][:location],
64:         'arguments' => "-f",
65:         'from' => params[:sendmail][:from],
66:         'recipients' => params[:sendmail][:recipients]]
67:       data = {'sendmail' => data}
68:       YAMLWriter.write(data, MAIL_FILE_PATH, "sendmail")
69:     else
70:       sendmail = Hash['location' => params[:sendmail][:location],
71:         'from' => params[:sendmail][:from],
72:         'recipients' => params[:sendmail][:recipients]]
73:       flash[:sendmail_errors] = str
74:     end
75:     redirect_to :controller => 'admin',:action => 'configuration',:sendmail => sendmail
76:   end

Method is used to save the smtp settings.

[Source]

     # File app/controllers/mail_specification_controller.rb, line 79
 79:   def save_smtp_settings
 80:     str = ""
 81:     str = check_for_smtp_validations(params[:smtp])
 82:     if str.length < 1
 83:       data = Hash['address' => params[:smtp][:address],
 84:         'port' => params[:smtp][:port],
 85:         'domain' => params[:smtp][:domain],
 86:         'authentication' => params[:smtp][:authentication],
 87:         'user_name' => params[:smtp][:user_name],
 88:         'password' => params[:smtp][:password],
 89:         'from' => params[:smtp][:from],
 90:         'recipients' => params[:smtp][:recipients]]
 91:       data = {'smtp' => data}
 92:       YAMLWriter.write(data, MAIL_FILE_PATH, "smtp")
 93:     else
 94:       smtp = Hash['address' => params[:smtp][:address],
 95:         'port' => params[:smtp][:port],
 96:         'domain' => params[:smtp][:domain],
 97:         'authentication' => params[:smtp][:authentication],
 98:         'user_name' => params[:smtp][:user_name],
 99:         'password' => params[:smtp][:password],
100:         'from' => params[:smtp][:from],
101:         'recipients' => params[:smtp][:recipients]]
102:       flash[:smtp_errors] = str        
103:     end
104:     redirect_to :controller => 'admin',:action => 'configuration',:smtp => smtp
105:   end

Method is used to render the sendmail settings form.

[Source]

    # File app/controllers/mail_specification_controller.rb, line 26
26:   def sendmail_form
27:     @sendmail_old = Hash['location' => '',
28:       'from' => '',
29:       'recipients' => '']
30:     render :partial => "sendmail_form"
31:   end

Method is used to render the smtp settings form.

[Source]

    # File app/controllers/mail_specification_controller.rb, line 34
34:   def smtp_form
35:     @smtp_old = Hash['address' => "",
36:       'port' => '25',
37:       'domain' => "",
38:       'authentication' => "login",
39:       'user_name' => "",
40:       'password' => "",
41:       'from' => "",
42:       'recipients' => ""]
43:     render :partial => "smtp_form"
44:   end

[Validate]