org.keycloak.email

## Interface EmailTemplateProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    FreeMarkerEmailTemplateProvider

      public interface EmailTemplateProvider
      extends Provider

  Author:
    Stian Thorgersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `IDENTITY_PROVIDER_BROKER_CONTEXT`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `send(String subjectFormatKey, List<Object> subjectAttributes, String bodyTemplate, Map<String,Object> bodyAttributes)` Send formatted email
    `void` | `send(String subjectFormatKey, String bodyTemplate, Map<String,Object> bodyAttributes)` Send formatted email
    `void` | `sendConfirmIdentityBrokerLink(String link, long expirationInMinutes)` Send to confirm that user wants to link his account with identity broker link
    `void` | `sendEvent(Event event)`
    `void` | `sendExecuteActions(String link, long expirationInMinutes)` Change password email requested by admin
    `void` | `sendPasswordReset(String link, long expirationInMinutes)` Reset password sent from forgot password link on login
    `void` | `sendSmtpTestEmail(Map<String,String> config, UserModel user)` Test SMTP connection with current logged in user
    `void` | `sendVerifyEmail(String link, long expirationInMinutes)`
    `EmailTemplateProvider` | `setAttribute(String name, Object value)`
    `EmailTemplateProvider` | `setAuthenticationSession(AuthenticationSessionModel authenticationSession)`
    `EmailTemplateProvider` | `setRealm(RealmModel realm)`
    `EmailTemplateProvider` | `setUser(UserModel user)`

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Field Detail

    - #### IDENTITY_PROVIDER_BROKER_CONTEXT

          static final String IDENTITY_PROVIDER_BROKER_CONTEXT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setAuthenticationSession

          EmailTemplateProvider setAuthenticationSession(AuthenticationSessionModel authenticationSession)

    - #### setRealm

          EmailTemplateProvider setRealm(RealmModel realm)

    - #### setUser

          EmailTemplateProvider setUser(UserModel user)

    - #### setAttribute

          EmailTemplateProvider setAttribute(String name,
                                             Object value)

    - #### sendEvent

          void sendEvent(Event event)
                  throws EmailException

      Throws:
        `EmailException`

    - #### sendPasswordReset

          void sendPasswordReset(String link,
                                 long expirationInMinutes)
                          throws EmailException

      Reset password sent from forgot password link on login
      Parameters:
        `link` -
        `expirationInMinutes` -
      Throws:
        `EmailException`

    - #### sendSmtpTestEmail

          void sendSmtpTestEmail(Map<String,String> config,
                                 UserModel user)
                          throws EmailException

      Test SMTP connection with current logged in user
      Parameters:
        `config` - SMTP server configuration
        `user` - SMTP recipient
      Throws:
        `EmailException`

    - #### sendConfirmIdentityBrokerLink

          void sendConfirmIdentityBrokerLink(String link,
                                             long expirationInMinutes)
                                      throws EmailException

      Send to confirm that user wants to link his account with identity broker link
      Throws:
        `EmailException`

    - #### sendExecuteActions

          void sendExecuteActions(String link,
                                  long expirationInMinutes)
                           throws EmailException

      Change password email requested by admin
      Parameters:
        `link` -
        `expirationInMinutes` -
      Throws:
        `EmailException`

    - #### sendVerifyEmail

          void sendVerifyEmail(String link,
                               long expirationInMinutes)
                        throws EmailException

      Throws:
        `EmailException`

    - #### send

          void send(String subjectFormatKey,
                    String bodyTemplate,
                    Map<String,Object> bodyAttributes)
             throws EmailException

      Send formatted email
      Parameters:
        `subjectFormatKey` - message property that will be used to format email subject
        `bodyTemplate` - freemarker template file
        `bodyAttributes` - attributes used to fill template
      Throws:
        `EmailException`

    - #### send

          void send(String subjectFormatKey,
                    List<Object> subjectAttributes,
                    String bodyTemplate,
                    Map<String,Object> bodyAttributes)
             throws EmailException

      Send formatted email
      Parameters:
        `subjectFormatKey` - message property that will be used to format email subject
        `subjectAttributes` - attributes used to fill subject format message
        `bodyTemplate` - freemarker template file
        `bodyAttributes` - attributes used to fill template
      Throws:
        `EmailException`

Copyright © 2021 JBoss by Red Hat. All rights reserved.