Skip to content

Instantly share code, notes, and snippets.

@AAlvarez90
Last active July 13, 2017 20:17
Show Gist options
  • Save AAlvarez90/d84a0afc79b50aa62ca06b5f0df014d8 to your computer and use it in GitHub Desktop.
Save AAlvarez90/d84a0afc79b50aa62ca06b5f0df014d8 to your computer and use it in GitHub Desktop.
Using the EmailAdviceImporter
  1. Load the branch: xpo_improvement
  2. Open Rails console
  3. Run the command: Resque.inline = true
  4. Grab the biller: biller = Biller.find <id>
  5. Create a new importer object: importer = Dade::EmailAdviceImporter.new
  6. Run the perform method on it: importer.perform('/Users/Abraham/Desktop/potential_advices', biller.id, 'doug@dadesystems.com')

Notes: The first parameter is the absolute path to that folder. The third parameter is the recipient used for the inbound addresses, you can put there an XPO email address ** IF you don't pass a recipient, it will default to one for CONWAY.

The perform method:
perform(advice_folders, billerId, recipient = 'EFTRemittance@con-way.com', auto_match = true)
** If you want the script to automatically create mappings after all the advices/cashes have been imported, then pass in true in the last argument:
E.G:
importer.perform('/Users/Abraham/Desktop/potential_advices', biller.id, 'doug@dadesystems.com', true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment