In one of app we are sending multiple PDFs as attachment, so instead of sending individual file we decided to send all PDFs in zip. I found a gem 'Rubyzip', to create temporary zip archive and send it as attachment.
Rubyzip is a ruby liabrary to reading and writing zip file.
To create a zip and send it as attachment using Rubyzip here’s a simple example:
Add gem in gemfile
Write function to create zip file:
def get_zip_data zip_file =...