thoughtbot / art_vandelay

Art Vandelay is an importer/exporter for Rails 7.0 and higher.
MIT License
79 stars 4 forks source link

How might we send one email with multiple exports? #30

Open stevepolitodesign opened 3 months ago

stevepolitodesign commented 3 months ago

Right now, there is no way to send one email with multiple exports. Instead, you need to send two emails, each containing a different query.

ArtVandelay::Export
  .new(User.where.not(confirmed: nil))
  .email_csv(
    to: ["george@vandelay_industries.com", "kel_varnsen@vandelay_industries.com"],
    from: "noreply@vandelay_industries.com",
    subject: "List of confirmed users",
    body: "Here's an export of all confirmed users in our database."
  )

ArtVandelay::Export
  .new(User.where.(confirmed: nil))
  .email_csv(
    to: ["george@vandelay_industries.com", "kel_varnsen@vandelay_industries.com"],
    from: "noreply@vandelay_industries.com",
    subject: "List of unconfirmed users",
    body: "Here's an export of all unconfirmed users in our database."
  )