Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

List All Email Templates with Multi Language

[

gist.github.com

https://gist.github.com/fhyfirman/f83235afd495955540c39be985b10e41

](https://gist.github.com/fhyfirman/f83235afd495955540c39be985b10e41)

require 'find'

# Define the directory to search
directory_to_search = 'app/views'

# Define the pattern to match files
file_pattern = /.*_th\.html\.erb$/

# Define the output file
output_file = 'email_templates_th.txt'

# Initialize an array to hold the matching file paths
matching_files = []

# Search for files matching the pattern
Find.find(directory_to_search) do |path|
  if path =~ file_pattern
    matching_files << path
  end
end

# Write the matching file paths to the output file
File.open(output_file, 'w') do |file|
  matching_files.each { |file_path| file.puts(file_path) }
end

puts "Matching files have been listed in #{output_file}"