You need to sign in to do that
Don't have an account?
Amit Singh 1
Urgent : Get Name From Email Id Using Apex
Hello Experts,
I have an urgent requirement in which I need to fetch the Email owner Name from email. Scenaron is given below :
1) I am sending an email from my email using email to case functionality.
2) If cpontact exists then it automaticaly attached that contact with the newly created case.
3) I am facing the problem when contact is not existing then I need to create contact with the actual name that is used into email for example my email id is testing@gmail.com and Name in gmail is Amit Singh then I need to insert contact as Amit Singh and email as testing@gmail.com
Any help will be greatly appreciated.
Please help :)
Thanks!
Amit Singh
I have an urgent requirement in which I need to fetch the Email owner Name from email. Scenaron is given below :
1) I am sending an email from my email using email to case functionality.
2) If cpontact exists then it automaticaly attached that contact with the newly created case.
3) I am facing the problem when contact is not existing then I need to create contact with the actual name that is used into email for example my email id is testing@gmail.com and Name in gmail is Amit Singh then I need to insert contact as Amit Singh and email as testing@gmail.com
Any help will be greatly appreciated.
Please help :)
Thanks!
Amit Singh
You need to fetch the name from the EmailMessage object.
Here is the SOQL query sample for you.
FromName is your field to fetch.
I suggest a Trigger or a Process on the EmailMessage object.
I believe ValidatedFromAddress would be blank in EmailMessage, if Contact is not present (But, I would let you validate this).
Let me know how it goes.
All Answers
You need to fetch the name from the EmailMessage object.
Here is the SOQL query sample for you.
FromName is your field to fetch.
I suggest a Trigger or a Process on the EmailMessage object.
I believe ValidatedFromAddress would be blank in EmailMessage, if Contact is not present (But, I would let you validate this).
Let me know how it goes.
Thank you.
Amit Singh