react-multi-email icon indicating copy to clipboard operation
react-multi-email copied to clipboard

add emails on format: John Johnson <[email protected]>

Open daggala opened this issue 3 years ago • 2 comments

It's quite common in gmail and other mail clients that the emails are displayed with the names and then the email inside chevrons, like this: John Johnson [email protected] (see gmail screenshot below)

Capture d’écran 2021-05-05 à 4 59 53 PM

It would be great to be able to copy paste this kind of format in the textfield and keep the format when it transforms into a chip:

Capture d’écran 2021-05-05 à 5 18 49 PM

daggala avatar May 05 '21 15:05 daggala

Pasteable example exactly how gmail supports it: Marsellus Wallace <[email protected]>, Winston Wolf <[email protected]>,.

Maybe this lib could parse the input to a list of objects? [{firstName: 'Marsellus', lastName: 'Wallace', email: '[email protected]'}, ...].

mileskin avatar Apr 18 '23 07:04 mileskin

How will this component know the user's name? You would need an external service for that. I would think that you could take the component onChange event and create a lookup array with names. Then just create your own display component in getLabel to match up the email (as the key) to your name lookup.

I was thinking the same. But, where do you get the full names? I guess a DB you build up somewhere?

Brian-McBride avatar May 12 '23 17:05 Brian-McBride