On 06/27/2017 04:30 PM, Paul Bronson via Users wrote:
> Hi everyone,
> 
> Can someone help me with inserting HTML into the OTP template? I have tired
> many different times and I am not familiar with the syntax that the system
> users. Any help would be appreciated. I have tried looking at websites for
> learning the syntax but It doesn't give a clear understanding of inserting
> the HTML.

Creating an HTML template is more or less similar to creating an HTML
email. The only thing that should be added is some freemarker code that
adds certain content. I'm not going to explain all details on how to
create an HTML email because there are probably a lot of tutorials
online for doing that.

For example, the "Encrypted PDF OTP Invite" mail contains the following
text part (take the text between BEGIN PART and END PART)

=============BEGIN PART=============
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

[SNIP]

<#assign passwordID = passwordContainer.passwordID!>
<#assign passwordLength = passwordContainer.passwordLength!>
<#assign baseURL = .vars["user.otpURL"]!>
<#if baseURL != "">
<#assign recipient = recipients[0]>
<#assign portalInvitations = mail.getAttribute("djigzo.portalInvitations")>
<#assign portalInvitation = portalInvitations[recipient]>
<#assign
url=baseURL+'?id='+passwordID+'&pwl='+passwordLength+'&email='+recipient?url('UTF-8')+'&ts='+portalInvitation.timestamp?c+'&action=signup&mac='+portalInvitation.mac>
${qp(url)}
</#if>

The password ID of this email is: ${passwordID}

<#if (from.personal)??>
Best regards,

${qp(from.personal)}
</#if>
=============END PART=============

The above part will result in the body text of the invite email. You can
replace this by replacing it with HTML content.

You should be careful with adding HTML because the body should be
quoted-printable encoded (this for example means that = need to be
written as =3D when used in the body). Alternatively you can base64
encode the complete body and set Content-Transfer-Encoding to base64.
This way you can use HTML without having to encode the = symbols.

Basic example (this is just an example of an HTML template and not
optimized nor good looking)

=============BEGIN PART=============
Content-Type: text/html; charset=UTF-8;
Content-Transfer-Encoding: quoted-printable

<html>
<body>
<p>Hi,</p>

<p>
This message contains a password encrypted pdf file. The password for
the pdf can be retrieved by logging into the web portal.
</p>

<p>
The first time you login, you need to choose a new password.
</p>

<p>
You can read the message by following these steps:
</p>

<ol>
  <li>click the link below.</li>
  <li>choose a password, and confirm it by typing it again.</li>
  <li>log in to the site with the password you just chose.</li>
  <li>press 'generate' to generate the password to the pdf file.</li>
  <li>copy the generated password.</li>
  <li>open the pdf file, attached to the email you received, and paste
the password in the password box.</li>
</ol>

<p>
Next time you receive an encrypted pdf file, the email will contain a
link, and you can login with your password
</p>

<#assign passwordID = passwordContainer.passwordID!>
<#assign passwordLength = passwordContainer.passwordLength!>
<#assign baseURL = .vars["user.otpURL"]!>
<#if baseURL != "">
<#assign recipient = recipients[0]>
<#assign portalInvitations = mail.getAttribute("djigzo.portalInvitations")>
<#assign portalInvitation = portalInvitations[recipient]>
<#assign
url=baseURL+'?id='+passwordID+'&pwl='+passwordLength+'&email='+recipient?url('UTF-8')+'&ts='+portalInvitation.timestamp?c+'&action=signup&mac='+portalInvitation.mac>
<a href=3D"${qp(url)}">link</a>
</#if>

<p>
The password ID of this email is: ${passwordID}
</p>

<#if (from.personal)??>
<p>
Best regards,<br><br>

${qp(from.personal)}
</p>
</#if>

<p>
---
Sent with CIPHERMAIL
</p>
=============END PART=============

I have attached the full example template. Other templates should be
done in a similar way.

An easy way to create HTML email is to use MJML (https://mjml.io/).

Kind regards,

Martijn Brinkers


-- 
CipherMail email encryption

Email encryption with support for S/MIME, OpenPGP, PDF encryption and
secure webmail pull.

https://www.ciphermail.com

Twitter: http://twitter.com/CipherMail
Content-Type: multipart/mixed; boundary="${boundary}"

--${boundary}
Content-Type: text/html; charset=UTF-8;
Content-Transfer-Encoding: quoted-printable

<html>
<body>
<p>Hi,</p>

<p>
This message contains a password encrypted pdf file. The password for
the pdf can be retrieved by logging into the web portal.
</p>

<p>
The <b>first</b> time you login, you need to choose a new password.
</p>

<p>
You can read the message by following these steps:
</p>

<ol>
  <li>click the link below.</li>
  <li>choose a password, and confirm it by typing it again.</li>
  <li>log in to the site with the password you just chose.</li>
  <li>press 'generate' to generate the password to the pdf file.</li>
  <li>copy the generated password.</li>
  <li>open the pdf file, attached to the email you received, and paste the 
password in the password box.</li>
</ol> 

<p>
Next time you receive an encrypted pdf file, the email will contain a
link, and you can login with your password
</p>

<#assign passwordID = passwordContainer.passwordID!>
<#assign passwordLength = passwordContainer.passwordLength!>
<#assign baseURL = .vars["user.otpURL"]!>
<#if baseURL != "">
<#assign recipient = recipients[0]>
<#assign portalInvitations = mail.getAttribute("djigzo.portalInvitations")>
<#assign portalInvitation = portalInvitations[recipient]>
<#assign 
url=baseURL+'?id='+passwordID+'&pwl='+passwordLength+'&email='+recipient?url('UTF-8')+'&ts='+portalInvitation.timestamp?c+'&action=signup&mac='+portalInvitation.mac>
<a href=3D"${qp(url)}">link</a>
</#if>


<p>
The password ID of this email is: <b>${passwordID}</b>
</p>

<#if (from.personal)??>
<p>
Best regards,<br><br>

${qp(from.personal)}
</p>
</#if>

<p>
---
Sent with CIPHERMAIL
</p>
--${boundary}
Content-Disposition: attachment; 
filename=encrypted_${passwordID}_${passwordLength}.pdf
Content-Type: application/pdf; 
name=encrypted_${passwordID}_${passwordLength}.pdf
Content-Transfer-Encoding: base64
X-Djigzo-Marker: attachment

JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURl
Y29kZT4+CnN0cmVhbQp4nB2KuwrCQBBF+/mKqYWNM2P2bgLLFBEt7AIDFmLnoxNM4+9nIwcOB+6V
TvlHXxZO0hJqzWXcvDz5uuPPf9xY3jQFZXQDF+vbIR68PyurcbxuFeoJ1aQIesAE8KFi9JQrjn6o
yH6PC52CZpp5Bfe6GasKZW5kc3RyZWFtCmVuZG9iagoKMyAwIG9iagoxMTQKZW5kb2JqCgo1IDAg
b2JqCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250L1RpbWVzLVJvbWFuCi9FbmNv
ZGluZy9XaW5BbnNpRW5jb2RpbmcKPj4KZW5kb2JqCgo2IDAgb2JqCjw8L0YxIDUgMCBSCj4+CmVu
ZG9iagoKNyAwIG9iago8PC9Gb250IDYgMC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MCBu
IAowMDAwMDAwNzI0IDAwMDAwIG4gCnRyYWlsZXIKPDwvU2l6ZSAxMC9Sb290IDggMCBSCi9JbmZv
IDkgMCBSCi9JRCBbIDwzRTlDMTAyOTVGNTgzMUNDRTdFQzFBREQ2OTFBNTk3Qz4KPDNFOUMxMDI5
NUY1ODMxQ0NFN0VDMUFERDY5MUE1OTdDPiBdCi9Eb2NDaGVja3N1bSAvMjc1QjJEQjg3OTIwNjZE
RTU1NEQwRTExQUI5RjI0NDcKPj4Kc3RhcnR4cmVmCjk1MgolJUVPRgo=


--${boundary}--

_______________________________________________
Users mailing list
Users@lists.djigzo.com
https://lists.djigzo.com/lists/listinfo/users

Reply via email to