Email CRM contacts by drawing an area on a map (UK). Built using Play Framework 2.3 (Scala). Follow @analytically for updates. Usage video available here!
Works with:
- Capsule CRM
- Coming soon: Salesforce
Java 7 or later. MongoDB at localhost:27017. A Capsule CRM account and token.
Requires Play Framework 2.3.
play assembly
This builds a single, executable 'fat' jar: target/scala-2.10/mapmailer.jar
.
Prebuilt releases are available here.
Capsule CRM users can find their API token by visiting My Preferences
via their username menu in the Capsule navigation bar.
See application.conf for more configurable options. In order to group your contacts, you need to add tags
(e.g. 'Customer' or 'VIP'). For persons the job title field (comma separated) will also be used as groups (e.g. 'CTO, Customer').
New and modified contacts should appear after 5-10 minutes.
Download and copy the CodePoint Open CSV (scroll halfway down, about 20 MB)
files to the codepointopen
directory in the same directory with the downloaded jar.
Start the application:
java -Dcapsulecrm.url=https://example.capsulecrm.com -Dcapsulecrm.token=abcdef123456789 -jar mapmailer.jar
After all CodePoint Open files are imported and processed, they are moved to the codepointopen/done
directory.
Then visit http://localhost:9000 and you should see the map.
Use a custom field to have a direct link from your contact to the map. In Capsule CRM, go to Settings
> Custom Field Settings: for People & Organisations
> Add new...
> Generated Link
and use your server in Link Definition
appended with ?partyId={id}
, for example:
- Play Framework 2.3 with Scala
- Apache Camel to process and monitor the
codepointopen
directory and to tell the actors about the postcodes - Akka provides a nice concurrency model to process the 1.7 million postcodes in under one minute on modern hardware
- MongoDB as database with two-dimensional geospatial indexes (see Geospatial Indexing)
- ReactiveMongo is a Scala MongoDB driver that provides fully non-blocking and asynchronous I/O operations
- Bootstrap, Font Awesome and Handlebars
Geo:
- GeoTools converts the CodePoint Open eastings/northings to latitude/longitude
- Leaflet for the map
- Leaflet Draw
- Leaflet awesome-markers plugin
- Thunderforest transport map
CRM:
- Unofficial Capsule CRM API Java Client - depends on Async Http Client, Google Guava, XStream and Joda-Time.
This software was built for Coen Recruitment, an education recruitment agency in the UK. They prioritise location and endeavour to find teachers work close to home, hence their consultants need map area selection to market teachers to schools efficiently. Parts of this project are based on CamelCode.
To enable basic authentication, specify the auth.username
and auth.password
properties:
java -Dauth.username=mycompany -Dauth.password=abc123 ... -jar mapmailer.jar
Licensed under the Apache License, Version 2.0.
Copyright 2014-2015 Mathias Bogaert.
This data contains Ordnance Survey data © Crown copyright and database right 2013. Code-Point Open contains Royal Mail data © Royal Mail copyright and database right 2012. Code-Point Open and ONSPD contains National Statistics data © Crown copyright and database right 2013.
OS data may be used under the terms of the OS OpenData licence.