Go to https://myaccount.google.com/apppasswords and generate an App Password
In terminal open the rails credentials
rails credentials:edit
Save the following info:
email:
user: [email protected]
password: PwdFromPrevStep
In production.rb, add the following
config.require_master_key = true
config.action_mailer.delivery_method = :smtp
host = 'yourhotelhelper.com'
config.action_mailer.default_url_options = { host: host }
config.action_mailer.smtp_settings = {
port: 587,
address: 'smtp.gmail.com',
user_name: Rails.application.credentials.dig(:email, :user),
password: Rails.application.credentials.dig(:email, :password),
authentication: :plain,
enable_starttls_auto: true
}