From 5d02099809298d81182c6b081b3f5557e09c34e0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Dec 2014 12:38:20 +0000 Subject: [PATCH] add personal part / full name to email when adding contacts from addressbook list to to, cc or bcc of mail compose --- addressbook/js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addressbook/js/app.js b/addressbook/js/app.js index d1b36dec14..0696251c16 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -657,13 +657,17 @@ app.classes.addressbook = AppJS.extend( var email_business = data.data[action.getManager().getActionById('email_business').checked ? 'email' : '']; var email = data.data[action.getManager().getActionById('email_home').checked ? 'email_home' : '']; + // prefix email with full name + var personal = data.data.n_fn || ''; + if (personal.match(/[^a-z0-9. -]/i)) personal = '"'+personal.replace(/"/, '\\"')+'"'; + if(email_business) { - emails.push(email_business); + emails.push((personal?personal+' <':'')+email_business+(personal?'>':'')); } if(email) { - emails.push(email); + emails.push((personal?personal+' <':'')+email+(personal?'>':'')); } } switch (action.id)