Search in sources :

Example 1 with EmailType

use of com.pratilipi.common.type.EmailType in project pratilipi by Pratilipi.

the class PratilipiSite method createDataModelForEmailTemplatesPage.

public Map<String, Object> createDataModelForEmailTemplatesPage(Language language) throws UnexpectedServerException, InsufficientAccessException {
    if (!UserAccessUtil.hasUserAccess(AccessTokenFilter.getAccessToken().getUserId(), language, AccessType.I18N_UPDATE))
        throw new InsufficientAccessException();
    Map<String, Object> dataModel = new HashMap<String, Object>();
    dataModel.put("title", "Email Templates - Admin Access");
    String body = new String();
    for (EmailType eT : EmailType.values()) {
        body = body + "<h4>" + eT.getDescription() + "</h4>";
        body = body + EmailTemplateUtil.getEmailTemplate(eT, language);
        body = body + "<br>";
    }
    dataModel.put("body", body);
    return dataModel;
}
Also used : EmailType(com.pratilipi.common.type.EmailType) HashMap(java.util.HashMap) JsonObject(com.google.gson.JsonObject) InsufficientAccessException(com.pratilipi.common.exception.InsufficientAccessException)

Aggregations

JsonObject (com.google.gson.JsonObject)1 InsufficientAccessException (com.pratilipi.common.exception.InsufficientAccessException)1 EmailType (com.pratilipi.common.type.EmailType)1 HashMap (java.util.HashMap)1