@SuppressWarnings("unchecked")
    public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException {
        if(!isAvailableToEmail(entity)) {
            throw new FMSException("Following entity: " + entity.getClass().getSimpleName() + " cannot be send as email" );
        }
        IntuitMessage intuitMessage = prepareEmail(entity, email);

        //execute interceptors
        executeInterceptors(intuitMessage);

        return (T) retrieveEntity(intuitMessage);
    }
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T sendEmail ( T entity , String email ) throws FMSException { if ( ! isAvailableToEmail ( entity ) ) { throw new FMSException ( "Following entity: " + entity . getClass ( ) . getSimpleName ( ) + " cannot be send as email" ) ; } IntuitMessage intuitMessage = prepareEmail ( entity , email ) ; executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
Send entity via email using specified address
@param entity
@param email
@param <T>
@return
@throws FMSException