Search in sources :

Example 1 with ProfileBean

use of org.keycloak.email.freemarker.beans.ProfileBean in project keycloak by keycloak.

the class FreeMarkerEmailTemplateProvider method sendExecuteActions.

@Override
public void sendExecuteActions(String link, long expirationInMinutes) throws EmailException {
    Map<String, Object> attributes = new HashMap<>(this.attributes);
    attributes.put("user", new ProfileBean(user));
    addLinkInfoIntoAttributes(link, expirationInMinutes, attributes);
    attributes.put("realmName", getRealmName());
    send("executeActionsSubject", "executeActions.ftl", attributes);
}
Also used : ProfileBean(org.keycloak.email.freemarker.beans.ProfileBean) HashMap(java.util.HashMap)

Example 2 with ProfileBean

use of org.keycloak.email.freemarker.beans.ProfileBean in project keycloak by keycloak.

the class FreeMarkerEmailTemplateProvider method sendPasswordReset.

@Override
public void sendPasswordReset(String link, long expirationInMinutes) throws EmailException {
    Map<String, Object> attributes = new HashMap<>(this.attributes);
    attributes.put("user", new ProfileBean(user));
    addLinkInfoIntoAttributes(link, expirationInMinutes, attributes);
    attributes.put("realmName", getRealmName());
    send("passwordResetSubject", "password-reset.ftl", attributes);
}
Also used : ProfileBean(org.keycloak.email.freemarker.beans.ProfileBean) HashMap(java.util.HashMap)

Example 3 with ProfileBean

use of org.keycloak.email.freemarker.beans.ProfileBean in project keycloak by keycloak.

the class FreeMarkerEmailTemplateProvider method sendEvent.

@Override
public void sendEvent(Event event) throws EmailException {
    Map<String, Object> attributes = new HashMap<>();
    attributes.put("user", new ProfileBean(user));
    attributes.put("event", new EventBean(event));
    send(toCamelCase(event.getType()) + "Subject", "event-" + event.getType().toString().toLowerCase() + ".ftl", attributes);
}
Also used : ProfileBean(org.keycloak.email.freemarker.beans.ProfileBean) EventBean(org.keycloak.email.freemarker.beans.EventBean) HashMap(java.util.HashMap)

Example 4 with ProfileBean

use of org.keycloak.email.freemarker.beans.ProfileBean in project keycloak by keycloak.

the class FreeMarkerEmailTemplateProvider method sendSmtpTestEmail.

@Override
public void sendSmtpTestEmail(Map<String, String> config, UserModel user) throws EmailException {
    setRealm(session.getContext().getRealm());
    setUser(user);
    Map<String, Object> attributes = new HashMap<>(this.attributes);
    attributes.put("user", new ProfileBean(user));
    attributes.put("realmName", realm.getName());
    EmailTemplate email = processTemplate("emailTestSubject", Collections.emptyList(), "email-test.ftl", attributes);
    send(config, email.getSubject(), email.getTextBody(), email.getHtmlBody());
}
Also used : ProfileBean(org.keycloak.email.freemarker.beans.ProfileBean) HashMap(java.util.HashMap)

Example 5 with ProfileBean

use of org.keycloak.email.freemarker.beans.ProfileBean in project keycloak by keycloak.

the class FreeMarkerEmailTemplateProvider method sendVerifyEmail.

@Override
public void sendVerifyEmail(String link, long expirationInMinutes) throws EmailException {
    Map<String, Object> attributes = new HashMap<>(this.attributes);
    attributes.put("user", new ProfileBean(user));
    addLinkInfoIntoAttributes(link, expirationInMinutes, attributes);
    attributes.put("realmName", getRealmName());
    send("emailVerificationSubject", "email-verification.ftl", attributes);
}
Also used : ProfileBean(org.keycloak.email.freemarker.beans.ProfileBean) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)6 ProfileBean (org.keycloak.email.freemarker.beans.ProfileBean)6 BrokeredIdentityContext (org.keycloak.broker.provider.BrokeredIdentityContext)1 EventBean (org.keycloak.email.freemarker.beans.EventBean)1