you have to define a new email service like below : -
create a Apex class named like "CreateRecordFrmEmail"
Your Name | Setup | Develop | Email Services .
refer the class which will be given below .
and use this class based on you logic.
/**
* Email services are automated processes that use Apex classes
* to process the contents, headers, and attachments of inbound
* email.
*/
global class CreateRecordFrmEmail implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,
Messaging.InboundEnvelope envelope) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
String emailbody = email.body;//you can get email body
String emailsubject = email.subject;//you can get email Subject
String subToCompare = 'New user registered';
//put you logic for your three parameters like Name, Position and subject.
if(email.body.equalsIgnoreCase(subToCompare))
{
//Do your record creation or other logic.
// Using this Save attachments, if any
for (Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments) {
Attachment attachment = new Attachment();
attachment.Name = tAttachment.fileName;
attachment.Body = Blob.valueOf(tAttachment.body);
attachment.ParentId = c.Id;
insert attachment;
}
//You can Binary Attachment also
for (Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) {
Attachment attachment = new Attachment();
attachment.Name = bAttachment.fileName;
attachment.Body = bAttachment.body;
attachment.ParentId = c.Id;
insert attachment;
}
}
result.success = true;
return result;
}
}
it will solve your purpose.