mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	Chore: Configure Letter opener with environment variable (#880)
This commit is contained in:
		| @@ -105,3 +105,7 @@ CHARGEBEE_WEBHOOK_PASSWORD= | |||||||
|  |  | ||||||
| ## Bot Customizations | ## Bot Customizations | ||||||
| USE_INBOX_AVATAR_FOR_BOT=true | USE_INBOX_AVATAR_FOR_BOT=true | ||||||
|  |  | ||||||
|  | ## Development Only Config | ||||||
|  | # if you want to use letter_opener for local emails | ||||||
|  | # LETTER_OPENER=true | ||||||
|   | |||||||
| @@ -34,18 +34,12 @@ Rails.application.configure do | |||||||
|  |  | ||||||
|   config.active_job.queue_adapter = :sidekiq |   config.active_job.queue_adapter = :sidekiq | ||||||
|  |  | ||||||
|  |   # Email related config | ||||||
|   config.action_mailer.perform_caching = false |   config.action_mailer.perform_caching = false | ||||||
|   config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } |  | ||||||
|  |  | ||||||
|   config.action_mailer.perform_deliveries = true |   config.action_mailer.perform_deliveries = true | ||||||
|   config.action_mailer.raise_delivery_errors = true |   config.action_mailer.raise_delivery_errors = true | ||||||
|   config.action_mailer.default_url_options = { host: 'localhost:3000' } |   config.action_mailer.default_url_options = { host: ENV['FRONTEND_URL'] } | ||||||
|  |  | ||||||
|   # If you want to use letter opener instead of mailhog for testing emails locally, |  | ||||||
|   # uncomment the following line L49 and comment lines L51 through to L65 |  | ||||||
|   # config.action_mailer.delivery_method = :letter_opener |  | ||||||
|  |  | ||||||
|   config.action_mailer.delivery_method = :smtp |  | ||||||
|   smtp_settings = { |   smtp_settings = { | ||||||
|     port: ENV['SMTP_PORT'] || 25, |     port: ENV['SMTP_PORT'] || 25, | ||||||
|     domain: ENV['SMTP_DOMAIN'] || 'localhost', |     domain: ENV['SMTP_DOMAIN'] || 'localhost', | ||||||
| @@ -59,7 +53,12 @@ Rails.application.configure do | |||||||
|     smtp_settings[:enable_starttls_auto] = ENV['SMTP_ENABLE_STARTTLS_AUTO'] if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present? |     smtp_settings[:enable_starttls_auto] = ENV['SMTP_ENABLE_STARTTLS_AUTO'] if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present? | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   config.action_mailer.smtp_settings = smtp_settings |   if ENV['LETTER_OPENER'] | ||||||
|  |     config.action_mailer.delivery_method = :letter_opener | ||||||
|  |   else | ||||||
|  |     config.action_mailer.delivery_method = :smtp | ||||||
|  |     config.action_mailer.smtp_settings = smtp_settings | ||||||
|  |   end | ||||||
|  |  | ||||||
|   # Set this to appropriate ingress service for which the options are : |   # Set this to appropriate ingress service for which the options are : | ||||||
|   # :relay for Exim, Postfix, Qmail |   # :relay for Exim, Postfix, Qmail | ||||||
| @@ -69,7 +68,7 @@ Rails.application.configure do | |||||||
|   # :sendgrid for Sendgrid |   # :sendgrid for Sendgrid | ||||||
|   config.action_mailbox.ingress = ENV.fetch('RAILS_INBOUND_EMAIL_SERVICE', 'relay').to_sym |   config.action_mailbox.ingress = ENV.fetch('RAILS_INBOUND_EMAIL_SERVICE', 'relay').to_sym | ||||||
|  |  | ||||||
|   Rails.application.routes.default_url_options = { host: 'localhost', port: 3000 } |   Rails.application.routes.default_url_options = { host: ENV['FRONTEND_URL'] } | ||||||
|  |  | ||||||
|   # Print deprecation notices to the Rails logger. |   # Print deprecation notices to the Rails logger. | ||||||
|   config.active_support.deprecation = :log |   config.active_support.deprecation = :log | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sojan Jose
					Sojan Jose