09-01-2024

This commit is contained in:
Jonathan Jenne 2024-01-09 11:01:33 +01:00
parent b849a8d87b
commit b7fbb21076
15 changed files with 730 additions and 32 deletions

View File

@ -12,12 +12,16 @@
EnvelopeArchived = 1007
EnvelopeTransmittedDMS = 1008
EnvelopeDeleted = 1009
DocumentOpened = 2001
DocumentSigned = 2002
SignatureConfirmed = 2003
AccessCodeRequested = 2001
AccessCodeCorrect = 2002
AccessCodeIncorrect = 2003
DocumentOpened = 2004
DocumentSigned = 2005
SignatureConfirmed = 2006
MessageInvitationSent = 3001 ' Wird von Trigger verwendet
MessageConfirmationSent = 3002
MessageDeletionSent = 3003
MessageAccessCodeSent = 3002
MessageConfirmationSent = 3003
MessageDeletionSent = 3004
End Enum
Public Enum ElementStatus

View File

@ -7,10 +7,11 @@ Public Class EmailData
Public Property ReferenceID As Integer
Public Property ReferenceString As String
Public Property ReceiverAccessCode As String
Public Property ReceiverName As String
Public Property SenderName As String
Public Property SenderAdress As String
Public Property SignatureLink As String
Public Property Message As String
Public Property EnvelopeTitle As String
@ -23,14 +24,10 @@ Public Class EmailData
ReferenceID = pEnvelope.Id
ReferenceString = pEnvelope.Uuid
ReceiverName = pReceiver.Name
ReceiverAccessCode = pReceiver.AccessCode
SenderAdress = pEnvelope.User.Email
SenderName = pEnvelope.User.FullName
EnvelopeTitle = pEnvelope.Title
End Sub
Public Sub New()
End Sub
End Class

View File

@ -5,11 +5,13 @@ Public Class EmailTemplate
Private _DocumentSignedBodyTemplate As List(Of String)
Private _DocumentCompletedBodyTemplate As List(Of String)
Private _DocumentDeletedBodyTemplate As List(Of String)
Private _DocumentAccessCodeReceivedBodyTemplate As List(Of String)
Private _DocumentReceivedSubjectTemplate As String
Private _DocumentSignedSubjectTemplate As String
Private _DocumentDeletedSubjectTemplate As String
Private _DocumentCompletedSubjectTemplate As String
Private _DocumentAccessCodeReceivedSubjectTemplate As String
Private _replaceDictionary As Dictionary(Of String, String)
@ -27,6 +29,8 @@ Public Class EmailTemplate
_DocumentSignedSubjectTemplate = "Dokument unterschrieben: '[DOCUMENT_TITLE]'"
_DocumentDeletedSubjectTemplate = "Vorgang zurückgezogen: '[DOCUMENT_TITLE]'"
_DocumentCompletedSubjectTemplate = "Vorgang abgeschlossen: '[DOCUMENT_TITLE]'"
_DocumentAccessCodeReceivedSubjectTemplate = "Dokument Passwort erhalten: '[DOCUMENT_TITLE]'"
End Sub
Private Sub InitBodyTemplates()
@ -44,6 +48,7 @@ Public Class EmailTemplate
}
'_DocumentReceivedBodyTemplate = Common.My.Resources.email_de.Split(vbNewLine).ToList()
'_DocumentAccessCodeReceivedBodyTemplate = Common.My.Resources.
_DocumentSignedBodyTemplate = New List(Of String) From {
"Guten Tag [NAME_RECEIVER]",
@ -72,6 +77,18 @@ Public Class EmailTemplate
"Vielen Dank für die Nutzung von",
"[NAME_PORTAL]"
}
_DocumentAccessCodeReceivedBodyTemplate = New List(Of String) From {
"Guten Tag [NAME_RECEIVER]",
"",
"[NAME_SENDER] hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. ",
"Verwenden Sie das folgende Passwort, um das Dokument einzusehen:",
"",
"[DOCUMENT_ACCESS_CODE]",
"",
"Vielen Dank für die Nutzung von",
"[NAME_PORTAL]"
}
End Sub
Private Sub InitDictionary(pEmailData As EmailData)
@ -83,7 +100,8 @@ Public Class EmailTemplate
{"[LINK_TO_DOCUMENT]", pEmailData.SignatureLink},
{"[LINK_TO_DOCUMENT_TEXT]", $"{pEmailData.SignatureLink.Truncate(40)}.."},
{"[DOCUMENT_TITLE]", pEmailData.EnvelopeTitle},
{"[MESSAGE]", pEmailData.Message}
{"[MESSAGE]", pEmailData.Message},
{"[DOCUMENT_ACCESS_CODE]", pEmailData.ReceiverAccessCode}
}
End Sub
@ -107,7 +125,12 @@ Public Class EmailTemplate
FillEmailSubject(pEmailData, _DocumentCompletedSubjectTemplate)
End Sub
Public Sub FillEmailSubject(pEmailData As EmailData, pTemplate As String)
Public Sub FillDocumentAccessCodeReceivedEmailBody(pEmailData As EmailData)
FillEmailBody(pEmailData, _DocumentAccessCodeReceivedBodyTemplate)
FillEmailSubject(pEmailData, _DocumentAccessCodeReceivedSubjectTemplate)
End Sub
Private Sub FillEmailSubject(pEmailData As EmailData, pTemplate As String)
InitDictionary(pEmailData)
Dim oSubject As String = pTemplate
@ -122,7 +145,7 @@ Public Class EmailTemplate
pEmailData.EmailSubject = oSubject
End Sub
Public Sub FillEmailBody(pEmailData As EmailData, pTemplate As List(Of String))
Private Sub FillEmailBody(pEmailData As EmailData, pTemplate As List(Of String))
InitDictionary(pEmailData)
Dim oBody As String = ""

View File

@ -277,6 +277,7 @@
<Content Include="Images\circle.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Templates\document_access_code_de.html" />
<EmbeddedResource Include="Templates\email_de.html" />
</ItemGroup>
<ItemGroup />

View File

@ -32,6 +32,7 @@ Public Class ReceiverModel
.Signature = pRow.ItemEx("SIGNATURE", ""),
.Status = ReceiverSignedStatus,
.ColorType = DirectCast(pColorIndex + 1, ColorType),
.AccessCode = pRow.ItemEx("ACCESS_CODE", ""),
.SignedDate = SignedDate
}
End Function
@ -261,10 +262,11 @@ Public Class ReceiverModel
End Try
End Function
Private Function GetSignedDate(pEmailAdress As String, pEnvleopeId As Integer) As Date
Private Function GetSignedDate(pEmailAddress As String, pEnvelopeId As Integer) As Date
Try
Return Database.GetScalarValue($"SELECT ACTION_DATE FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY] WHERE ENVELOPE_ID = {pEnvleopeId}
AND USER_REFERENCE = '{pEmailAdress}' AND [STATUS] = 2002")
Dim oStatusInt As Integer = EnvelopeStatus.DocumentSigned
Return Database.GetScalarValue($"SELECT ACTION_DATE FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY] WHERE ENVELOPE_ID = {pEnvelopeId}
And USER_REFERENCE = '{pEmailAddress}' AND [STATUS] = {oStatusInt}")
Catch ex As Exception
Logger.Error(ex)
@ -272,4 +274,17 @@ Public Class ReceiverModel
End Try
End Function
Public Function AccessCodeAlreadyRequested(pEmailAddress As String, pEnvelopeId As Integer) As Boolean
Try
Dim oStatusInt As Integer = EnvelopeStatus.AccessCodeRequested
Dim oResult As Integer = Database.GetScalarValue($"SELECT COUNT(*) FROM [DD_ECM].[dbo].[TBSIG_ENVELOPE_HISTORY]
WHERE ENVELOPE_ID = {pEnvelopeId} And USER_REFERENCE = '{pEmailAddress}' AND [STATUS] = {oStatusInt}")
Return oResult > 0
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
End Class

View File

@ -60,6 +60,36 @@ Public Class ActionService
Return True
End Function
Public Function RequestAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oUserReference = pReceiver.Email
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeRequested, oUserReference) = False Then
Return False
End If
Return True
End Function
Public Function EnterCorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oUserReference = pReceiver.Email
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeCorrect, oUserReference) = False Then
Return False
End If
Return True
End Function
Public Function EnterIncorrectAccessCode(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oUserReference = pReceiver.Email
If HistoryService.SetEnvelopeStatus(pEnvelope, Constants.EnvelopeStatus.AccessCodeIncorrect, oUserReference) = False Then
Return False
End If
Return True
End Function
Public Function SignEnvelope(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oUserReference = pReceiver.Email

View File

@ -5,8 +5,6 @@ Imports DigitalData.Modules.Logging
Public Class EmailService
Inherits BaseService
Private ReadOnly State As State
Private ReadOnly EnvelopeModel As EnvelopeModel
Private ReadOnly ReceiverModel As ReceiverModel
Private ReadOnly EmailModel As EmailModel
@ -54,6 +52,23 @@ Public Class EmailService
Return True
End Function
Public Function SendDocumentAccessCodeReceivedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oEmailData As New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageAccessCodeSent) With
{
.SignatureLink = Helpers.GetEnvelopeURL(State.DbConfig.SignatureHost, pEnvelope.Uuid, pReceiver.Signature)
}
EmailTemplate.FillDocumentAccessCodeReceivedEmailBody(oEmailData)
If EmailModel.Insert(oEmailData) = False Then
Logger.Error("EMail data could not be inserted.")
Return False
End If
Return True
End Function
Public Function SendSignedEmail(pEnvelope As Envelope, pReceiver As EnvelopeReceiver) As Boolean
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageConfirmationSent) With
{

View File

@ -0,0 +1,450 @@
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" lang="und" style="padding:0;Margin:0">
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'none'; connect-src 'none'; object-src 'none'; form-action 'none';">
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta name="x-apple-disable-message-reformatting">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="telephone=no" name="format-detection">
<title>Trigger newsletter 3 </title>
<!--[if (mso 16)]>
<style type="text/css">
a {text-decoration: none;}
</style>
<![endif]-->
<!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]-->
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG></o:AllowPNG>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i" rel="stylesheet"><!--<![endif]-->
<style type="text/css">
#outlook a {
padding: 0;
}
.ExternalClass {
width: 100%;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.es-button {
mso-style-priority: 100 !important;
text-decoration: none !important;
}
a[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
.es-desk-hidden {
display: none;
float: left;
overflow: hidden;
width: 0;
max-height: 0;
line-height: 0;
mso-hide: all;
}
@media only screen and (max-width:600px) {
p, ul li, ol li, a {
line-height: 150% !important
}
h1, h2, h3, h1 a, h2 a, h3 a {
line-height: 120% !important
}
h1 {
font-size: 30px !important;
text-align: center
}
h2 {
font-size: 26px !important;
text-align: left
}
h3 {
font-size: 20px !important;
text-align: left
}
h1 a {
text-align: center
}
.es-header-body h1 a, .es-content-body h1 a, .es-footer-body h1 a {
font-size: 30px !important
}
h2 a {
text-align: left
}
.es-header-body h2 a, .es-content-body h2 a, .es-footer-body h2 a {
font-size: 20px !important
}
h3 a {
text-align: left
}
.es-header-body h3 a, .es-content-body h3 a, .es-footer-body h3 a {
font-size: 20px !important
}
.es-menu td a {
font-size: 16px !important
}
.es-header-body p, .es-header-body ul li, .es-header-body ol li, .es-header-body a {
font-size: 16px !important
}
.es-content-body p, .es-content-body ul li, .es-content-body ol li, .es-content-body a {
font-size: 17px !important
}
.es-footer-body p, .es-footer-body ul li, .es-footer-body ol li, .es-footer-body a {
font-size: 17px !important
}
.es-infoblock p, .es-infoblock ul li, .es-infoblock ol li, .es-infoblock a {
font-size: 12px !important
}
*[class="gmail-fix"] {
display: none !important
}
.es-m-txt-c, .es-m-txt-c h1, .es-m-txt-c h2, .es-m-txt-c h3 {
text-align: center !important
}
.es-m-txt-r, .es-m-txt-r h1, .es-m-txt-r h2, .es-m-txt-r h3 {
text-align: right !important
}
.es-m-txt-l, .es-m-txt-l h1, .es-m-txt-l h2, .es-m-txt-l h3 {
text-align: left !important
}
.es-m-txt-r img, .es-m-txt-c img, .es-m-txt-l img {
display: inline !important
}
.es-button-border {
display: inline-block !important
}
a.es-button, button.es-button {
font-size: 14px !important;
display: inline-block !important;
padding: 15px 25px 15px 25px !important
}
.es-btn-fw {
border-width: 10px 0px !important;
text-align: center !important
}
.es-adaptive table, .es-btn-fw, .es-btn-fw-brdr, .es-left, .es-right {
width: 100% !important
}
.es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header {
width: 100% !important;
max-width: 600px !important
}
.es-adapt-td {
display: block !important;
width: 100% !important
}
.adapt-img {
width: 100% !important;
height: auto !important
}
.es-m-p0 {
padding: 0px !important
}
.es-m-p0r {
padding-right: 0px !important
}
.es-m-p0l {
padding-left: 0px !important
}
.es-m-p0t {
padding-top: 0px !important
}
.es-m-p0b {
padding-bottom: 0 !important
}
.es-m-p20b {
padding-bottom: 20px !important
}
.es-mobile-hidden, .es-hidden {
display: none !important
}
tr.es-desk-hidden, td.es-desk-hidden, table.es-desk-hidden {
width: auto !important;
overflow: visible !important;
float: none !important;
max-height: inherit !important;
line-height: inherit !important
}
tr.es-desk-hidden {
display: table-row !important
}
table.es-desk-hidden {
display: table !important
}
td.es-desk-menu-hidden {
display: table-cell !important
}
.es-menu td {
width: 1% !important
}
table.es-table-not-adapt, .esd-block-html table {
width: auto !important
}
table.es-social {
display: inline-block !important
}
table.es-social td {
display: inline-block !important
}
.es-desk-hidden {
display: table-row !important;
width: auto !important;
overflow: visible !important;
max-height: inherit !important
}
}
@media screen and (max-width:384px) {
.mail-message-content {
width: 414px !important
}
}
</style>
<body style="width:100%;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0">
<div dir="ltr" class="es-wrapper-color" lang="und" style="background-color:#F1F1F1">
<!--[if gte mso 9]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
<v:fill type="tile" color="#f1f1f1"></v:fill>
</v:background>
<![endif]-->
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;padding:0;Margin:0;width:100%;height:100%;background-repeat:repeat;background-position:center top;background-color:#F1F1F1">
<tbody>
<tr style="border-collapse:collapse">
<td valign="top" style="padding:0;Margin:0">
<table class="es-header" cellspacing="0" cellpadding="0" align="center" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top">
<tbody>
<tr style="border-collapse:collapse">
<td align="center" style="padding:0;Margin:0">
<table class="es-header-body" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:transparent;width:600px" cellspacing="0" cellpadding="0" align="center" role="none">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="Margin:0;padding-top:30px;padding-bottom:30px;padding-left:40px;padding-right:40px">
<!--[if mso]><table style="width:520px" cellpadding="0"
cellspacing="0"><tr><td style="width:250px" valign="top"><![endif]-->
<table class="es-left" cellspacing="0" cellpadding="0" align="left" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
<tbody>
<tr style="border-collapse:collapse">
<td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:250px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;font-size:0"><a href="https://viewstripo.email" target="_blank" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#FFFFFF;font-size:14px"><img src="https://tlr.stripocdn.email/content/guids/CABINET_85e4431b39e3c4492fca561009cef9b5/images/92961521447916451.png" alt="" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" width="57"></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><!--[if mso]></td><td style="width:20px"></td><td style="width:250px" valign="top"><![endif]-->
<table class="es-right" cellspacing="0" cellpadding="0" align="right" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;width:250px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td class="es-infoblock es-m-txt-c" align="right" style="padding:0;Margin:0;line-height:14px;font-size:12px;color:#CCCCCC"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica\ neue', helvetica, sans-serif;line-height:14px;color:#CCCCCC;font-size:12px">Put your preheader text here</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><!--[if mso]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="es-content" cellspacing="0" cellpadding="0" align="center" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%">
<tbody>
<tr style="border-collapse:collapse">
<td align="center" style="padding:0;Margin:0">
<table class="es-content-body" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;border-top:1px solid #dddddd;border-right:1px solid #dddddd;border-left:1px solid #dddddd;width:600px;border-bottom:1px solid #dddddd" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" role="none">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-top:40px;padding-left:40px;padding-right:40px">
<table width="100%" cellspacing="0" cellpadding="0" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td valign="top" align="center" style="padding:0;Margin:0;width:518px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-top:5px;padding-bottom:15px"><h2 style="Margin:0;line-height:24px;mso-line-height-rule:exactly;font-family:lato, 'helvetica neue', helvetica, arial, sans-serif;font-size:20px;font-style:normal;font-weight:bold;color:#333333">[MAIL_SUBJECT]</h2></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:23px;color:#555555;font-size:15px"><strong></strong><strong>Guten Tag [NAME_RECEIVER],</strong><strong></strong></p></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-top:10px;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:23px;color:#555555;font-size:15px">[NAME_SENDER] hat Ihnen ein Dokument zum [SIGNATURE_TYPE] gesendet. Verwenden Sie das folgende Passwort, um das Dokument einzusehen:</p><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:23px;color:#555555;font-size:15px">[DOCUMENT_ACCESS_CODE]<br></p></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-top:10px;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:23px;color:#555555;font-size:15px">Mit freundlichen Grüßen,</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="Margin:0;padding-top:10px;padding-bottom:40px;padding-left:40px;padding-right:40px">
<!--[if mso]><table style="width:518px" cellpadding="0"
cellspacing="0"><tr><td style="width:39px" valign="top"><![endif]-->
<table class="es-left" cellspacing="0" cellpadding="0" align="left" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
<tbody>
<tr style="border-collapse:collapse">
<td class="es-m-p0r es-m-p20b" valign="top" align="center" style="padding:0;Margin:0;width:39px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;font-size:0"><img src="https://tlr.stripocdn.email/content/guids/CABINET_85e4431b39e3c4492fca561009cef9b5/images/29241521207598269.jpg" alt="" style="display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" width="39"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><!--[if mso]></td><td style="width:20px"></td><td style="width:459px" valign="top"><![endif]-->
<table cellspacing="0" cellpadding="0" align="right" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;width:459px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-top:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:21px;color:#222222;font-size:14px"><strong>[NAME_PORTAL]</strong><br></p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table><!--[if mso]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table class="es-footer" cellspacing="0" cellpadding="0" align="center" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;table-layout:fixed !important;width:100%;background-color:transparent;background-repeat:repeat;background-position:center top">
<tbody>
<tr style="border-collapse:collapse">
<td align="center" style="padding:0;Margin:0">
<table class="es-footer-body" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:transparent;width:600px" cellspacing="0" cellpadding="0" align="center" role="none">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="Margin:0;padding-top:40px;padding-bottom:40px;padding-left:40px;padding-right:40px">
<table width="100%" cellspacing="0" cellpadding="0" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td valign="top" align="center" style="padding:0;Margin:0;width:520px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tbody>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:18px;color:#666666;font-size:12px">Company Address</p></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:18px;color:#666666;font-size:12px">This email was sent to you from Company Email Address</p></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0;padding-bottom:10px"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:18px;color:#666666;font-size:12px"><a target="_blank" href="https://viewstripo.email/" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#666666;font-size:12px">Preferences</a> | <a target="_blank" href="https://viewstripo.email/" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#666666;font-size:12px">Browser</a> | <a target="_blank" href="https://viewstripo.email/" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#666666;font-size:12px">Forward</a> | <a target="_blank" class="unsubscribe" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:underline;color:#666666;font-size:12px" href="">Unsubscribe</a></p></td>
</tr>
<tr style="border-collapse:collapse">
<td align="left" style="padding:0;Margin:0"><p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;line-height:18px;color:#666666;font-size:12px">Copyright © 2015-2018 <strong>Company Name</strong>, All Rights Reserved.<br></p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@ -80,6 +80,7 @@ Partial Class frmMain
Me.GridColumn5 = New DevExpress.XtraGrid.Columns.GridColumn()
Me.GridColumn7 = New DevExpress.XtraGrid.Columns.GridColumn()
Me.RefreshTimer = New System.Windows.Forms.Timer(Me.components)
Me.colAccessCode = New DevExpress.XtraGrid.Columns.GridColumn()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.Panel1.SuspendLayout()
@ -157,7 +158,7 @@ Partial Class frmMain
'
'ViewReceivers
'
Me.ViewReceivers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.ColReceiverStatus, Me.ColName, Me.ColEmail, Me.ColSignedDate, Me.ColStatusReceiver})
Me.ViewReceivers.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.ColReceiverStatus, Me.ColName, Me.ColEmail, Me.ColSignedDate, Me.colAccessCode, Me.ColStatusReceiver})
Me.ViewReceivers.GridControl = Me.GridEnvelopes
Me.ViewReceivers.Name = "ViewReceivers"
Me.ViewReceivers.OptionsBehavior.Editable = False
@ -552,6 +553,12 @@ Partial Class frmMain
'
Me.RefreshTimer.Interval = 120000
'
'colAccessCode
'
resources.ApplyResources(Me.colAccessCode, "colAccessCode")
Me.colAccessCode.FieldName = "AccessCode"
Me.colAccessCode.Name = "colAccessCode"
'
'frmMain
'
resources.ApplyResources(Me, "$this")
@ -640,4 +647,5 @@ Partial Class frmMain
Friend WithEvents btnOpenLogDirectory As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents colAccessCode As DevExpress.XtraGrid.Columns.GridColumn
End Class

View File

@ -166,7 +166,7 @@
<value>0</value>
</data>
<data name="ColReceiverStatus.Width" type="System.Int32, mscorlib">
<value>138</value>
<value>129</value>
</data>
<data name="ColName.Caption" xml:space="preserve">
<value>Email Anrede</value>
@ -178,7 +178,7 @@
<value>1</value>
</data>
<data name="ColName.Width" type="System.Int32, mscorlib">
<value>435</value>
<value>406</value>
</data>
<data name="ColEmail.Caption" xml:space="preserve">
<value>Email</value>
@ -190,7 +190,7 @@
<value>2</value>
</data>
<data name="ColEmail.Width" type="System.Int32, mscorlib">
<value>377</value>
<value>332</value>
</data>
<data name="ColSignedDate.Caption" xml:space="preserve">
<value>Unterschrieben wann</value>
@ -199,10 +199,22 @@
<value>True</value>
</data>
<data name="ColSignedDate.VisibleIndex" type="System.Int32, mscorlib">
<value>3</value>
<value>4</value>
</data>
<data name="ColSignedDate.Width" type="System.Int32, mscorlib">
<value>134</value>
<value>110</value>
</data>
<data name="colAccessCode.Caption" xml:space="preserve">
<value>Zugangscode</value>
</data>
<data name="colAccessCode.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="colAccessCode.VisibleIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="colAccessCode.Width" type="System.Int32, mscorlib">
<value>107</value>
</data>
<data name="ColStatusReceiver.Caption" xml:space="preserve">
<value>Status</value>
@ -1265,6 +1277,12 @@
<data name="&gt;&gt;RefreshTimer.Type" xml:space="preserve">
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;colAccessCode.Name" xml:space="preserve">
<value>colAccessCode</value>
</data>
<data name="&gt;&gt;colAccessCode.Type" xml:space="preserve">
<value>DevExpress.XtraGrid.Columns.GridColumn, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>frmMain</value>
</data>

View File

@ -2,6 +2,7 @@
using EnvelopeGenerator.Web.Models;
using EnvelopeGenerator.Web.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using System.Diagnostics;
namespace EnvelopeGenerator.Web.Controllers
@ -10,7 +11,7 @@ namespace EnvelopeGenerator.Web.Controllers
{
private readonly EnvelopeService _envelopeService;
public HomeController(DatabaseService database, LoggingService logging, EnvelopeService envelopeService): base(database, logging)
public HomeController(DatabaseService databaseService, LoggingService loggingService, EnvelopeService envelopeService): base(databaseService, loggingService)
{
_envelopeService = envelopeService;
}
@ -28,12 +29,83 @@ namespace EnvelopeGenerator.Web.Controllers
[HttpGet]
[Route("/EnvelopeKey/{EnvelopeReceiverId}")]
public IActionResult ShowEnvelope()
{
string envelopeKey = (string)HttpContext.Request.RouteValues["EnvelopeReceiverId"];
EnvelopeResponse response = _envelopeService.LoadEnvelope(envelopeKey);
string accessCode = response.Receiver.AccessCode;
if (!String.IsNullOrEmpty(accessCode))
{
bool accessCodeAlreadyRequested = database.Models.receiverModel.AccessCodeAlreadyRequested(response.Receiver.Email, response.Envelope.Id);
if (!accessCodeAlreadyRequested)
{
// Send email with password
bool actionResult = database.Services.actionService.RequestAccessCode(response.Envelope, response.Receiver);
bool result = database.Services.emailService.SendDocumentAccessCodeReceivedEmail(response.Envelope, response.Receiver);
}
return Redirect($"/EnvelopeKey/{envelopeKey}/Locked");
}
else
{
ViewData["EnvelopeKey"] = envelopeKey;
return View();
}
}
[HttpPost]
[Route("/EnvelopeKey/{EnvelopeReceiverId}/Locked")]
public IActionResult ShowEnvelopePost()
{
string envelopeKey = (string)HttpContext.Request.RouteValues["EnvelopeReceiverId"];
StringValues accessCodeFromForm = HttpContext.Request.Form["access_code"];
if (accessCodeFromForm.Count == 0)
{
return Redirect($"/EnvelopeKey/{envelopeKey}/Locked");
}
if (accessCodeFromForm.Count > 1)
{
return Redirect($"/EnvelopeKey/{envelopeKey}/Locked");
}
EnvelopeResponse response = _envelopeService.LoadEnvelope(envelopeKey);
string accessCode = response.Receiver.AccessCode;
if (string.IsNullOrEmpty(accessCodeFromForm[0]))
{
return Redirect($"/EnvelopeKey/{envelopeKey}/Locked");
}
if (accessCode.Equals(accessCodeFromForm[0], StringComparison.Ordinal))
{
bool actionResult = database.Services.actionService.EnterCorrectAccessCode(response.Envelope, response.Receiver);
ViewData["EnvelopeKey"] = envelopeKey;
return View("ShowEnvelope");
}
else
{
bool actionResult = database.Services.actionService.EnterIncorrectAccessCode(response.Envelope, response.Receiver);
return Redirect($"/EnvelopeKey/{envelopeKey}/Locked");
}
}
[HttpGet]
[Route("/EnvelopeKey/{EnvelopeReceiverId}/Locked")]
public IActionResult EnvelopeLocked()
{
ViewData["EnvelopeKey"] = HttpContext.Request.RouteValues["EnvelopeReceiverId"];
return View();
}
[HttpGet]
[Route("/EnvelopeKey/{EnvelopeReceiverId}/Success")]
public IActionResult EnvelopeSigned()

View File

@ -12,10 +12,12 @@ namespace EnvelopeGenerator.Web.Services
public class ServiceContainer
{
public ActionService actionService;
public EmailService emailService;
public ServiceContainer(State state)
{
actionService = new(state);
emailService = new(state);
}
}

View File

@ -0,0 +1,32 @@
@{
ViewData["Title"] = "Dokument geschützt";
}
<div id="page-locked" class="container p-5">
<header class="text-center">
<div class="icon bg-warning text-black">
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" fill="currentColor" class="bi bi-shield-lock" viewBox="0 0 16 16">
<path d="M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56" />
<path d="M9.5 6.5a1.5 1.5 0 0 1-1 1.415l.385 1.99a.5.5 0 0 1-.491.595h-.788a.5.5 0 0 1-.49-.595l.384-1.99a1.5 1.5 0 1 1 2-1.415" />
</svg>
</div>
<h1>Dokument erfordert ein Passwort</h1>
</header>
<section class="text-center">
<p>Wir haben Ihnen das Passwort an die hinterlegte Email Adresse gesendet.</p>
</section>
<section>
<form id="form-access-code" method="post">
<div class="input">
<label class="visually-hidden" for="access_code">PAsswort</label>
<input type="password" class="form-control" name="access_code" placeholder="Passwort" required="required">
</div>
<div class="button">
<button type="submit" class="btn btn-primary">Öffnen</button>
</div>
</form>
</section>
</div>

View File

@ -1,4 +1,5 @@
@using EnvelopeGenerator.Common;
@using static EnvelopeGenerator.Common.Constants;
@{
ViewData["Title"] = "Home Page";
}
@ -13,12 +14,20 @@
<div class="container">
<section>
<ul>
@foreach (Envelope envelope in @Model)
{
<li><a href="/EnvelopeKey/@encodeEnvelopeKey(envelope)">@envelope.Title</a></li>
}
</ul>
@foreach (IGrouping<EnvelopeStatus, Envelope> group in ((List<Envelope>)@Model).GroupBy(item => item.Status).OrderBy(item => (int)item.Key))
{
<section>
<h2>@group.Key.ToString()</h2>
<ul>
@foreach (Envelope envelope in @group)
{
<li><a href="/EnvelopeKey/@encodeEnvelopeKey(envelope)">@envelope.Title</a></li>
}
</ul>
<hr />
</section>
}
</section>
</div>

View File

@ -50,3 +50,25 @@
padding: 15px;
margin-bottom: 2rem;
}
/* Locked Page */
#page-locked header .icon {
display: inline-block;
border-radius: 10px;
padding: 15px;
margin-bottom: 2rem;
}
#form-access-code {
max-width: 30rem;
margin: 2rem auto;
display: flex;
gap: 1rem;
}
#form-access-code > .input {
flex-grow: 1;
}