Inbound email notifications - retrieve mailer name

rafas_10
Tera Guru

Hi everyone,

 

Currently I have an inbound action created which I want to use to retrieve the name of the sender.

For example, when you receive an email it displays as 'Example user <example.user@gmail.com>.

 

How can I retrieve the 'Example user'  in my inbound to populate the field 'people_name' for example?

 

Appreciate the help!

7 REPLIES 7

Hi Mark,

 

I tried that approach and indeed is not the best at all. That's why I'm trying to retrieve the names to try another approach 🙂

Its_Azar
Kilo Sage

Hi there @rafas_10 

 

ou can retrieve the display name directly from the email object using email.from_name. This will give you “Example user” from an address like Example user <example.user@gmail.com>. You can then simply populate your field, for example: current.people_name = email.from_name;. If from_name is empty (some emails don’t include it), a common fallback is to parse email.from or look up the user by email address in sys_user.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

Hi Azar,

 

It's retrieving 'undefined' with that. Maybe the SMTP is not passing everything correctly or system limitation or so, which is unfortunate