I was writing a trigger to send email . after inserting a record i was getting an id of that record in trigger. Using this trigger i want to get email id from external webservice.
trigger sendEmail on Task (after insert) {
for(Task task: Trigger.new){
Id id=task.ID;
GetEmailIDbyBSId gm=new GetEmailIDbyBSId();
String email= gm.getEmail(id);
}
code of GetEmailIDbyBSId calss
public class GetEmailIDbyBSId {
public String getEmail(String BluestarId)
{
String email;
// code for invoking external system and getting related email id
return email;
}
}
but here the big problem is 'Callout from triggers are currently not supported.' ,when i uase @future i cannot return email Id. So is there any way to achieve this. And the main thing is i am not supposed to store email id in any object i have to get it through web service call and have to store it in a variable for email processing