public EmailTracking retrieveTracking(Long emailId) {
return (EmailTracking) em.find(entityConfiguration.lookupEntityClass("org.broadleafcommerce.common.email.domain.EmailTracking"), emailId);
}
public void recordOpen(Long emailId, String userAgent) {
EmailTrackingOpens opens = (EmailTrackingOpens) entityConfiguration.createEntityInstance("org.broadleafcommerce.common.email.domain.EmailTrackingOpens");
opens.setEmailTracking(retrieveTracking(emailId));
opens.setDateOpened(SystemTime.asDate());
opens.setUserAgent(userAgent);
em.persist(opens);
}