module.exports.updatePreferences = function(data) {
return pg.connectAsync(connString).bind({}).spread(function(client, close) {
this.close = close;
return client.queryAsync('UPDATE subscribers SET email = $1, company_name = $2, contact_name = $3, phone = $4, can_email = $5, can_sms = $6, email_limit = $7, sms_limit = $8 WHERE username = $9', [data.email, data.company_name, data.contact_name, data.phone, data.can_email, data.can_sms, data.email_limit, data.sms_limit, data.username]);