You need to sign in to do that
Don't have an account?
Waseem Akram
Autoresponse to the email, record should be created automatically
I Wrote a code to send email alerts to all contacts when an event is created. But my question is when we respond to that email then automatically a record should be created in child object named Participants for which Event is a parent. How to achieve this??
My code is:
Global class CreateInboundMember implements Messaging.InboundEmailHandler {
Global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
String myPlainText= '';
myPlainText = email.plainTextBody;
List<Participants__c> part = new List<Participants__c>();
try {
contact c=new contact();
Participants__c p = new Participants__c(Name__c=c.Name, Email__c=c.Email);
part.add(p);
insert part;
System.debug('New Participant: ' + part);
}
catch (Exception e) {
System.debug('Error is: ' + e);
}
result.success = true;
return result;
}
}
Please correct me if i am wrong
My code is:
Global class CreateInboundMember implements Messaging.InboundEmailHandler {
Global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
String myPlainText= '';
myPlainText = email.plainTextBody;
List<Participants__c> part = new List<Participants__c>();
try {
contact c=new contact();
Participants__c p = new Participants__c(Name__c=c.Name, Email__c=c.Email);
part.add(p);
insert part;
System.debug('New Participant: ' + part);
}
catch (Exception e) {
System.debug('Error is: ' + e);
}
result.success = true;
return result;
}
}
Please correct me if i am wrong