Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mycrm

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycrm

  • 0.0.43
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Mycrm Gem

A library to simplify communication with the MyCrm data service.

Configuration

storage = Redis.new({"host"=>"localhost", "port"=>6379, "namespace"=>"loan-market-platform-development"})
Mycrm.configure do |conf|
  conf.base_uri = 'https://api.endopoint.com'
  conf.username = 'some-user-name'
  conf.password = 'very-secret'
  conf.logger = ::Logger.new(STDOUT)
  conf.storage = storage
  conf.token_storage_expiry = 600 # in seconds default 10 minutes (600)
  # it overrides the default domains' values
  conf.domains = {
    sources: {
      lm_contact_us: -9
    },
    purposes: {
      first_home: 17207
    },
    loan_features:{
      other: 16928
    },
    adviser_sources:{
      loan_market_careers_website: 16
    },
    adviser_types:{
      mortgage_broker: 7829
    },
    other_option:{
      other: 36928
    }
  }
end

Create a new simple lead

lead = Mycrm::Facades::Lead.new
lead.first_name = 'Michael'
lead.last_name = 'Stephens'
lead.email = 'michael.stephens@example.com'
lead.mobile = '0555123457'
lead.home_address = '135 King Street, 2000, Sydney, NSW, Australia'
lead.mobile_validated = true
lead.allocated_broker_id = 858860
lead.source = 'Lm Contact Us'
lead.activity_title = 'Gem Enquiry!'
lead.activity_details = 'I would like to ask...'

lead.create!

Create a new lead with loan application

lead = Mycrm::Facades::LeadApplication.new
lead.first_name = 'Michael'
lead.last_name = 'Stephens'
lead.email = 'michael.stephens@example.com'
lead.mobile = '0555123457'
lead.home_address = '135 King Street, Sydney, 2000, NSW'
lead.mobile_validated = true
lead.allocated_broker_id = 858860
lead.source = 'Lm Contact Us'
lead.settlement_date = "2017-06-06T23:38:18.609Z"
lead.add_purpose 'First Home'
lead.add_feature 'Other'
lead.loan_term = 120
lead.loan_amount = 35000
lead.activity_title = 'Gem Enquiry!'
lead.activity_details = 'I would like to ask...'

lead.create!

Create a new prospect adviser

adviser = Mycrm::Models::Adviser.new
adviser.first_name = 'James'
adviser.last_name = 'Smith'
adviser.email = 'james.smith@example.com'
adviser.mobile = '0555123457'
adviser.business_phone = '0405666555'
adviser.business_address = '135 King Street, Sydney, 2000, NSW'
adviser.summary = "I'm looking for job!"
adviser.source = 'Loan Market Careers Website'
adviser.reporting_country = 'Australia'
adviser.type = 'Mortgage Broker'

adviser.create!

Development

Running tests in development

Some of the tests run against the test instance of the actual My CRM API.

To run these locally add a .env.local file with API_BASE_URI, API_USERNAME, and API_PASSWORD:

API_BASE_URI=https://testapi.nzfsg.co.nz
API_USERNAME=$api-user-email
API_PASSWORD=$api-user-password

Get the propper details off one of the Loan Market developers.

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc