Great news. This week 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.
Tonight I worked out the Google App Script that will connect to the DNN DB and grab your user database. Run the script and use the sheet then to do a mail merge with Mail Chimp is the idea. Your mailing list is never out of date. It works great...
Here is the script:
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()));
}
Enjoy,
Dave