github.com/greenpau/go-authcrunch@v1.1.4/pkg/messaging/email_template_body.go (about)

     1  // Copyright 2022 Paul Greenberg greenpau@outlook.com
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package messaging
    16  
    17  // EmailTemplateBody stores email body templates.
    18  var EmailTemplateBody = map[string]string{
    19  	"en/registration_confirmation": `<html>
    20    <body>
    21      <p>
    22        Please confirm your registration by clicking this
    23        <a href="{{ .registration_url }}/ack/{{ .registration_id }}">link</a>
    24        and providing the registration code <b><code>{{ .registration_code }}</code></b>
    25        within the next 45 minutes. If you haven't done so, please re-register.
    26      </p>
    27  
    28      <p>The registation metadata follows:</p>
    29      <ul style="list-style-type: disc">
    30        <li>Session ID: {{ .session_id }}</li>
    31        <li>Request ID: {{ .request_id }}</li>
    32        <li>Username: <code>{{ .username }}</code></li>
    33        <li>Email: <code>{{ .email }}</code></li>
    34        <li>IP Address: <code>{{ .src_ip }}</code></li>
    35        <li>Timestamp: {{ .timestamp }}</li>
    36      </ul>
    37    </body>
    38  </html>`,
    39  	"en/registration_ready": `<html>
    40    <body>
    41      <p>
    42        The following user successfully registered with the portal.
    43        Please use management interface to approve or decline the registration.
    44      </p>
    45  
    46      <p>The registation metadata follows:</p>
    47      <ul style="list-style-type: disc">
    48        <li>Registration ID: {{ .registration_id }}</li>
    49        <li>Registration URL: <code>{{ .registration_url }}</code></li>
    50        <li>Session ID: {{ .session_id }}</li>
    51        <li>Request ID: {{ .request_id }}</li>
    52        <li>Username: <code>{{ .username }}</code></li>
    53        <li>Email: <code>{{ .email }}</code></li>
    54        <li>IP Address: <code>{{ .src_ip }}</code></li>
    55        <li>Timestamp: {{ .timestamp }}</li>
    56      </ul>
    57    </body>
    58  </html>`,
    59  	"en/registration_verdict": `<html>
    60    <body>
    61      <p>
    62      {{- if eq .verdict "approved" -}}
    63        Your registration has been approved.
    64        You may now login with the username or email
    65        address below.
    66      {{- else -}}
    67        Your registration has been declined.
    68      {{- end -}}
    69      </p>
    70      <p>The registation metadata follows:</p>
    71      <ul style="list-style-type: disc">
    72        <li>Username: <code>{{ .username }}</code></li>
    73        <li>Email: <code>{{ .email }}</code></li>
    74        <li>Timestamp: {{ .timestamp }}</li>
    75      </ul>
    76    </body>
    77  </html>`,
    78  }