Skip to main content

MS Office Addins

For example, you can create plugin for MS outlook which will import emails from your mailbox. Add-in Mapping

Create your Command

This command will search your Customer Contacts and import selected email as a new communication.

(model, db, ctx) =>
{
if (String.IsNullOrEmpty(model.From))
{
throw new BusinessException("FROM is empty");
}
if (String.IsNullOrEmpty(model.To))
{
throw new BusinessException("FROM is empty");
}

var contact = db.CustomerContactSet.FirstOrDefault(c =>
!string.IsNullOrEmpty(c.Email)
&& (
model.From.Equals(c.Email, StringComparison.InvariantCultureIgnoreCase) ||
model.To.Contains(c.Email, StringComparison.InvariantCultureIgnoreCase))
);

if (contact == null)
{
throw new BusinessException($"Could not find contact for email addresses {model.From}/{model.To}");
}


var msg = model.Body;


contact.Customer.Communications.Add(new CustomerCommunication()
{
CommunicationType = CommunicationType.EMAIL,
When = model.Date,
Contact = contact,
Message = msg,
Title = model.Subject
});
}

Create your AddIn and Define mapping

Add-in Mapping