File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11class TestMailer < ApplicationMailer
2+ after_deliver :announce_test_email_success , only : :send_test_email
3+
24 def send_test_email ( email )
35 puts ""
46 puts "--> Configured FROM: address: '#{ Settings . mail . mailer_sender } '"
@@ -64,17 +66,21 @@ def send_test_email(email)
6466
6567 puts ""
6668 puts "--> Attempting to send a test email to #{ email } ..."
67- mail ( to : email ,
68- subject : "Test Email from Password Pusher" ,
69- body : "⭐ If you are reading this, sending email works! ⭐ " )
70-
71- puts "--> ✅ It seems that the Email was accepted by the SMTP server! Check destination inbox for the test email."
7269 puts ""
73-
7470 puts "--> If you see an error, please paste this output into a GitHub issue for help."
7571 puts " --> Make sure that no sensitive data is included."
7672 puts " --> https://github.com/pglombardo/PasswordPusher/issues/new/choose"
73+ puts ""
7774
75+ mail ( to : email ,
76+ subject : "Test Email from Password Pusher" ,
77+ body : "⭐ If you are reading this, sending email works! ⭐ " )
78+ end
79+
80+ private
81+
82+ def announce_test_email_success
83+ puts "--> ✅ It seems that the Email was accepted by the SMTP server! Check destination inbox for the test email."
7884 puts ""
7985 end
8086end
Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ mail:
337337
338338 # When using TLS, you can set how OpenSSL checks the certificate. This is
339339 # useful if you need to validate a self-signed and/or a wildcard certificate.
340- # This can be one of the OpenSSL verify constants, : none or : peer
340+ # Must be a string name of an OpenSSL verify constant: ' none' or ' peer'
341341 # Environment Variable Override: PWP__MAIL__SMTP_OPENSSL_VERIFY_MODE='none'
342342 # smtp_openssl_verify_mode: 'peer'
343343
Original file line number Diff line number Diff line change 163163 config . action_mailer . smtp_settings [ :password ] = Settings . mail . smtp_password
164164 end
165165
166+ # Pass a String ("none" / "peer"). The mail gem maps strings to OpenSSL::SSL::VERIFY_*
167+ # constants; a Symbol like :none raises TypeError during TLS handshake.
166168 if !Settings . mail . smtp_openssl_verify_mode . nil?
167- config . action_mailer . smtp_settings [ :openssl_verify_mode ] = Settings . mail . smtp_openssl_verify_mode . to_sym
169+ config . action_mailer . smtp_settings [ :openssl_verify_mode ] = Settings . mail . smtp_openssl_verify_mode . to_s
168170 end
169171
170172 if !Settings . mail . smtp_enable_starttls_auto . nil?
171173 config . action_mailer . smtp_settings [ :enable_starttls_auto ] = Settings . mail . smtp_enable_starttls_auto
172174 end
173175
174- if !Settings . mail . smtp_enable_starttls . nil?
175- config . action_mailer . smtp_settings [ :enable_starttls ] = Settings . mail . smtp_enable_starttls
176+ # settings.yml / PWP__MAIL__SMTP_STARTTLS maps to smtp_starttls
177+ if !Settings . mail . smtp_starttls . nil?
178+ config . action_mailer . smtp_settings [ :enable_starttls ] = Settings . mail . smtp_starttls
176179 end
177180 end
178181
Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ mail:
337337
338338 # When using TLS, you can set how OpenSSL checks the certificate. This is
339339 # useful if you need to validate a self-signed and/or a wildcard certificate.
340- # This can be one of the OpenSSL verify constants, : none or : peer
340+ # Must be a string name of an OpenSSL verify constant: ' none' or ' peer'
341341 # Environment Variable Override: PWP__MAIL__SMTP_OPENSSL_VERIFY_MODE='none'
342342 # smtp_openssl_verify_mode: 'peer'
343343
You can’t perform that action at this time.
0 commit comments