All threads / Any good idea how to import CSV via Sendgrid email attachment and update model/database columns.

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Any good idea how to import CSV via Sendgrid email attachment and update model/database columns.

Daniel Chapman asked in Rails

Basically receive incoming daily emails, with CSV attachment, then importing the CSV rows to your desired model/database.

Anyone done this before?

Thanks for any input.

Should be pretty straightforward with https://github.com/thoughtbot/griddler

Readme there is pretty clear too!

Thanks, ill check it out.

Be sure to add any questions if you have any!

Daniel I'm with Jack and recommend you use Griddler for inbound email. I currently use it to capture attachments on inbound emails and store them to S3.

Process the email, check for a filetype of CSV (or against name etc.) then process as a normal CSV import. Ruby supports this natively or you can use the smarter-csv gem.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 38,558+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.