[keycloak-user] Sending Emails with HTML Templates

Lohitha Chiranjeewa kalc04 at gmail.com
Mon May 25 05:27:39 EDT 2015


Thanks for the reply Iván.

When I track the SMTP request sent by Keycloak (through tcpdump), I can see
the following parameters:

From: admin at xxxxx.com
To: user at xxxxx.com
Message-ID: <16547339.4.1432541195530.JavaMail.xxxx at xxxx>
Subject: Reset password
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The issue here is, since the email process is handled by Keycloak, the
client (me) has no control over it. It seems either Keycloak explicitly
sets the content-type to be text/plain, or it gets added as a default
value. Either way, I haven't seen any place where I can configure the
content-type through Keycloak Admin Console or any other place. Is there
such a configurable entry somewhere? Or can I get this done through some
other measure?


Regards,
Lohitha.

On Mon, May 25, 2015 at 2:27 PM, Iván Perdomo <ivan at akvo.org> wrote:

> Hi,
>
>
>
> On 05/25/2015 10:22 AM, Lohitha Chiranjeewa wrote:
> > Hi,
> >
> > The default email FTLs are in plain text. I have tried to enhance them
> > by adding HTML styling. However, when I do that the email bodies don't
> > get styled accordingly. Instead the exact HTML code gets returned in the
> > email body.
> >
> > I have verified that my email server supports HTML styling (through
> > external email requests). So what could be the issue here?
>
> My guess the email is using `plain/text` as default content type for the
> email. You need to set it up to "text/html; charset=utf-8"
>
> See:
>
> *
>
> https://github.com/keycloak/keycloak/blob/1.2.0.Final/forms/email-freemarker/src/main/java/org/keycloak/email/freemarker/FreeMarkerEmailProvider.java#L142
> * http://stackoverflow.com/a/5068907
>
> >
> >
> > Thanks,
> > Lohitha.
> >
> >
> > _______________________________________________
> > keycloak-user mailing list
> > keycloak-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-user
> >
>
> --
> Iván
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20150525/c92d741e/attachment.html 


More information about the keycloak-user mailing list