You need to sign in to do that
Don't have an account?
chiranth
Email To case
When a user is sending an email from a case, the senders email address should be based on the case record type. If the case record type is returns, then it should be returns@Test.com. If recor dtype is test then it should be test@test.com.
How can this be done ?? Please help me on this.
Thanks
Yes, it's possible but you'll need to write some apex code for it.
All Answers
You can use Organization-Wide Email Addresses for sending emails.
Ya i have used it . But what i need is like, Once i click on the send email button on case the from address hould me automatically poplated based on the record type selected.
If the case record type is quote then from address should be quote@test.com ,
If the case recor dtype is bill then from address should be bill@test.com,
Is this possible?
Yes, it's possible but you'll need to write some apex code for it.
Can u please post any sample code ? It will be helpful.
Something like that should do the trick
c represent your case
EmailTemplate et = [SELECT id FROM EmailTemplate WHERE developerName = 'Your Template name depend on the recordtype'];
OrgWideEmailAddress owea = [SELECT id FROM OrgWideEmailAddress WHERE DisplayName = 'Your Org name depend on the recordtype'];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(c.Contact.Id); // Specify who the email should be sent to.
mail.setTemplateId(c.id);
mail.whatId = c.Contact.Account.Id;
mail.orgWideEmailAddressId = owea.Id;
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});