finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))varMiddleName(\")?( )*/*( )*(>|(>))", (user.getMiddleName()!=null) ? user.getMiddleName() : "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))/varLastName(>|(>))", "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))varLastName(\")?( )*/*( )*(>|(>))", (user.getLastName()!=null) ? user.getLastName() : "");
UserProxy userproxy;
try {
userproxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);
} catch (Exception e) {
Logger.error(EmailFactory.class, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))/varLastMessage(>|(>))", "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))varLastMessage(\")?( )*/*( )*(>|(>))", (userproxy.getLastMessage()!=null) ? userproxy.getLastMessage() : "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))/varAddress1(>|(>))", "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))varAddress1(\")?( )*/*( )*(>|(>))", (address.getStreet1()!=null) ? address.getStreet1() : "");
finalMessageStr = finalMessageStr.replaceAll("(?i)(<|(<))/varAddress2(>|(>))", "");