Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

2.4 KB
Raw Blame
{{ define "subscription-form" }}
{{ template "header" . }}
<section>
    <h2>{{ L.T "globals.buttons.subscribe" }}</h2>

    <form method="post" action="" class="form">
        <div>
            <p>
                <label for="email">{{ L.T "globals.fields.email" }}</label>
                <input id="email" name="email" required="true" type="email" placeholder="{{ L.T "globals.fields.email" }}" autofocus="true" >

                <input name="nonce" class="nonce" value="" />
            </p>
            <p>
                <label for="name">{{ L.T "public.subName" }}</label>
                <input id="name" name="name" type="text" placeholder="{{ L.T "public.subName" }}" >
            </p>

            <ul class="lists">
                <h2>{{ L.T "globals.terms.lists" }}</h2>
                {{ range $i, $l := .Data.Lists }}
                    <li>
                        <input checked="true" id="l-{{ $l.UUID}}" type="checkbox" name="l" value="{{ $l.UUID }}" >
                        <label for="l-{{ $l.UUID}}">{{ $l.Name }}</label>
                        {{ if ne $l.Description "" }}
                            <p class="description">{{ $l.Description }}</p>
                        {{ end }}
                    </li>
                {{ end }}
            </ul>

            {{ if .Data.Captcha.Enabled }}
                <div class="captcha">
                    {{ if eq .Data.Captcha.Provider "hcaptcha" }}
                        <div class="h-captcha" data-sitekey="{{ .Data.Captcha.Key }}"></div>
                        <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
                    {{ else if eq .Data.Captcha.Provider "altcha" }}
                        <altcha-widget challenge="{{ .RootURL }}/api/public/captcha/altcha"></altcha-widget>
                        <script type="module" src="{{ .RootURL }}/public/static/altcha.umd.js" async defer></script>
                    {{ end }}
                </div>
            {{ end }}
            <p>
                <button type="submit" class="button">{{ L.T "globals.buttons.subscribe" }}</button>

                {{ if .EnablePublicArchive }}
                    <p class="right">
                        <a href="{{ .RootURL }}/archive">{{ L.T "public.archiveTitle" }}</a>
                    </p>
                {{ end }}
            </p>
        </div>
    </form>
</section>

{{ template "footer" .}}
{{ end }}