All Downloads are FREE. Search and download functionalities are using the official Maven repository.

woko.ext.usermanagement.mail.BaseMailTemplate Maven / Gradle / Ivy

There is a newer version: 2.4-beta7
Show newest version
package woko.ext.usermanagement.mail;

import woko.Woko;
import woko.mail.PropertyBasedMailTemplate;

import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static woko.ext.usermanagement.mail.BindingHelper.getAppName;
import static woko.ext.usermanagement.mail.BindingHelper.getAppUrl;
import static woko.ext.usermanagement.mail.BindingHelper.getUsername;

public abstract class BaseMailTemplate extends PropertyBasedMailTemplate {

    public BaseMailTemplate(String keySubject, String keyBody) {
        super(keySubject, keyBody);
    }

    @Override
    protected List getArgsSubject(Woko woko, Locale locale, Map binding) {
        return Arrays.asList(getAppName(binding));
    }

    @Override
    protected List getArgsBody(Woko woko, Locale locale, Map binding) {
        return Arrays.asList(
                getUsername(binding),
                getAppName(binding),
                getAppUrl(binding));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy