Module: BridgetownPluginNano::Commands::Nano::EmailHelpers

Included in:
BridgetownPluginNano::Commands::Nano
Defined in:
lib/bridgetown-plugin-nano/command_helpers/email_helpers.rb

Instance Method Summary collapse

Instance Method Details

#configure_action_mailerObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bridgetown-plugin-nano/command_helpers/email_helpers.rb', line 7

def configure_action_mailer
  self.destination_root = File.expand_path(folder_name)

  say_status :nano, %(Setting up ActionMailer in "#{folder_name}")
  directory "email", ".", exclude_pattern: %r!DS_Store$!
  inject_into_file "config/application.rb",
                   "require \"action_mailer/railtie\"\n",
                   after: "require \"action_controller/railtie\"\n"
  append_to_file(
    "config/base_classes.rb",
    "\n" + File.read("#{self.class.source_root}/base_classes/application_mailer.rb")
  )

  say_status :nano, "ActionMailer configuration complete!"
  say_status :nano, "Take a look at #{folder_name}/test_mailer.rb for an example mailer,"
  say_status :nano, "and #{folder_name}/config/initializers/email.rb to set " \
                    "up your SMTP connection."
end