Skip to content

Instantly share code, notes, and snippets.

@bvjebin
Last active August 31, 2018 12:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bvjebin/252ddfb08acb77944c1f838f7e9cd46e to your computer and use it in GitHub Desktop.
def export_download_zip_email(data, email) do
tmp_folder_name = "users_"<>Random.random_string(8)
path = File.cwd!<>"/tmp/"<>tmp_folder_name
:ok = File.mkdir_p!(path)
csv_path = export_to_csv(data, path)
download_images(data, path)
zip_path = create_zip(data, path)
send_email(email, csv_path, zip_path)
File.rm_rf path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment