Background
Google
docs is a freeware web-based office suite offered by Google within its Google Drive service. It was formerly a storage service as well, but has since been replaced by Drive.
4 It allows users to create and edit documents online while collaborating with other users live
In early March 2014, Google added "Addons" to their Google Docs platform. One of the addons in the initial launch of the store is a Email Merge by Mail Chimp addon. It's now possible to use a Google App Script that will connect to the DNN DB and grab your user database, that can then use the data against an add-on such as Mail chimp. The following script shows how to import data into a sheet and then do a mail merge with Mail Chimp.
function database_connection() {
var conn = Jdbc.getConnection("jdbc:sqlserver://IP-address:1433;" + "databaseName=DBName;user=username;password=password;");
var stmt = conn.createStatement();
stmt.setMaxRows(500);
var start = new Date();
var rs = stmt.executeQuery('select * from users');
var doc = SpreadsheetApp.getActiveSpreadsheet();
var cell = doc.getRange('a1');
var row = 0;
while (rs.next()) {
for (var col = 0; col < rs.getMetaData().getColumnCount(); col++) {
cell.offset(row, col).setValue(rs.getString(col + 1));
}
row++;
}
rs.close();
stmt.close();
conn.close();
var end = new Date();
Logger.log('Time elapsed: ' + (end.getTime() - start.getTime()));
}
- thanks go to Dave Lalande who wrote the original forum post