Keycloak's FreeMarker email template - html-email

I'm using Keycloak to send a forgot password email, and from what I've read on their docs and the FreeMarker docs, it seems like I should be able to use HTML tags just fine. However, when I use them in the password-rest.ftl file, it renders the whole tag like so:
<p>Some Text</p>
instead of just showing: Some Text
I found this (https://issues.jboss.org/browse/KEYCLOAK-681) saying that Keycloak can only send plain text emails, and I just wanted to see if anyone knew for sure since I have found some stuff that looks like the HTML tags should be usable How do you block emails from appearing as links in FreeMarker?
Any advice or thoughts on this would be greatly appreciated.

There are two sub-directories containing templates for emails. They are called text and html. When you want HTML you need to edit templates located in html directory.
Keycloak itself sends emails as multi-part messages containing both plain-text and HTML versions - email client decides which one is displayed.

I am not familiar with Keycloak, but somehow you should set the Mime type of your e-mail to "text/html" (e.g. have a look at this Stack Overflow answer).
Which version of Keycloak are you using? Comparing the source code of 'FreeMarkerEmailProvider' in tag 1.2.0.Final and on branch 1.3.x lets me assume that Keycloak is able to handle text/html at least from version 1.3.x on.
But again: I am not familiar with Keycloak...

Related

HTML Email Not Generating Links (A tags) in Outlook

In checking an email that I am coding (a reply-type email that my server will send), I notice that the a tag hyperlinks in my code are not working in Outlook. They work elsewhere, but not Outlook.
I know very little about Microsoft products, but I can tell you that the place I'm seeing this is in the online outlook.com you view in a web browser.
The simplest link, such as this...
Click here
...is coming through like this in the rendered email:
[http:www.yahoo.com]Click here
AND, it is not a link. It's just text. It appears as though the program is disabling the links (possibly because it finds the email suspicious of phishing, even though I added the domain to my trusted emails)???
Anyone know what is happening or how I can work around this?
I don't see anything wrong with the code you've posted, but I do know that Outlook.com will do this to links when it doesn't recognize them as valid links to an external site. Look for hidden characters, "smart" quotes instead of plain quotes, etc. in the link.
You should put the target on the link.
Like this:
Click here

Email ext plugin to send HTML Junit reports in mail

I have used this below code in default content to generate text Junit test reports.
${JELLY_SCRIPT,template="text"}
But now I wanted same in HTML format. I have changed content type to HTML and placed below code in default content -
${FILE,path="index.html"}
But I am getting html code in my email. Where did I miss ? Any Suggestions..
If you are seeing HTML code in you email, maybe you need to set the content type of the email to HTML(text/html).
You can change the Default Content Type to HTML(text/html) in the Jenkins System Configuration in the Extended E-mail Notification section.
Alternatively you can change the content type in the Job configuration.
If you are using Email ext plugin, then go to your workspace, there should be an 'emailable-report.html' generated. So set the correct path in default content like this:
${FILE,path="path/to/your/emailable-report.html"}
Instead of index.html , given path for those HTML files which are generated like all-tests.html. It worked fine. There may be a issue with frames.

Direct mail (typo3) only content is send. Newsletter Layout not being send (page layout)

When I am sending a direct mail newsletter as a test, everything looks fine. But when I am sending a newsletter to users only the content without my wrapping template is being send. The user seeĀ“s only the content elements in the newsletter. My html template is missing.
By content, do you mean that users see only plain text? If so, it might be due to subscriptions preferences.
Based on your settings, both fe_users and tt_address may have a flag called "Recieve HTML mails" (can't recall the exact english version) which by default is not set.
Please let us know a bit more about your installation if this doesn't help :)

Drupal email file attachment on form submit

I have a form built into a block on one of my content types, the content type has a file connected to the node.
I currently have a form the will send an email to the address you put in with a default message (ie if you put into the form, me#myemail.com, this email will receive a message saying "thank you for your interest.. ..please find your document attached" etc) However I'm struggling when it comes to attaching the file attachment of that node to the form, I have downloaded the mimemail module but there isn't a lot of documentation on how to do it.
(I apologise for repeating this question from the Drupal specific SO but this area seems to get more traffic)
Firstly, I would recommend you transition to webform rather than your own bespoke solution - as great and admirable as that is.
In looking around for a webform strategy to test and recommend, I found something that should do the job for you.
Have a look at this tutorial.

CSS Selector on Responsive Email template

I am currently studying on Responsive Email template. I saw some of the templates online using Attribute Selector like this: h1[class="title"]. Why don't just just h1.title, is there any special trick for doing Email template like this?
This trick is done to stop some email clients from recognizing this tag. The most common use of this would be to hide tags that are only used in a mobile version of this email.
For instance the Yahoo.com email client, does not recognize media types or css using the bracketed format. So by using this format you can trick Yahoo mail to not parse css specifically used for the mobile version.