apiVersion: notification.halo.run/v1alpha1
kind: ReasonType
metadata:
  name: sharelink-download-verification
spec:
  displayName: "资源下载邮箱验证"
  description: "访客下载需要邮箱验证的资源时，向其邮箱发送数字验证码。"
  properties:
    - name: username
      type: string
    - name: code
      type: string
    - name: expirationAtMinutes
      type: string
---
apiVersion: notification.halo.run/v1alpha1
kind: NotificationTemplate
metadata:
  name: template-sharelink-download-verification
spec:
  reasonSelector:
    reasonType: sharelink-download-verification
    language: default
  template:
    title: "资源下载验证码-[(${site.title})]"
    rawBody: |
      【[(${site.title})]】你的资源下载验证码是：[(${code})]，请在 [(${expirationAtMinutes})] 分钟内完成验证。若不是你本人操作，请忽略。
    htmlBody: |
      <div class="notification-content">
        <div class="head">
          <p class="honorific" th:text="|${username} 你好：|"></p>
        </div>
        <div class="body">
          <p>你正在 [(${site.title})] 下载资源，使用下面的验证码验证邮箱：</p>
          <div class="verify-code" style="font-size:24px;line-height:24px;color:#333;">
            <b th:text="${code}"></b>
          </div>
          <p th:text="|验证码 ${expirationAtMinutes} 分钟内有效。若不是你本人操作，请忽略。|"></p>
        </div>
      </div>
