mailtrain/views/settings.hbs
2018-08-01 10:46:34 +02:00

456 lines
25 KiB
Handlebars

<ol class="breadcrumb">
<li><a href="/">{{#translate}}Home{{/translate}}</a></li>
<li class="active">{{#translate}}Settings{{/translate}}</li>
</ol>
<h2>{{#translate}}Settings{{/translate}}</h2>
<hr>
<form method="post" id="smtp-verify" action="/settings/smtp-verify">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
</form>
<form class="form-horizontal" id="settings-form" method="post" action="/settings/update">
<input type="hidden" name="_csrf" value="{{csrfToken}}">
<fieldset>
<legend>
{{#translate}}General Settings{{/translate}}
</legend>
<div class="form-group">
<label for="service-url" class="col-sm-2 control-label">{{#translate}}Service Address (URL){{/translate}}</label>
<div class="col-sm-10">
<input type="url" class="form-control" name="service-url" id="service-url" placeholder="http://example.com/" value="{{serviceUrl}}" required>
<span class="help-block">{{#translate}}Enter the URL this service can be reached from{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="admin-email" class="col-sm-2 control-label">{{#translate}}Admin Email{{/translate}}</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="admin-email" id="admin-email" placeholder="admin@example.com" value="{{adminEmail}}" required>
<span class="help-block">{{#translate}}Enter the email address that will be used as "from" for system messages{{/translate}}</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" name="disable-wysiwyg" {{#if disableWysiwyg}} checked {{/if}}> {{#translate}}Disable WYSIWYG editor{{/translate}}
<span class="help-block">{{#translate}}If checked then message editor displays HTML code without the preview{{/translate}}</span>
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" name="disable-confirmations" {{#if disableConfirmations}} checked {{/if}}> {{#translate}}Disable subscription confirmation messages{{/translate}}
<span class="help-block">{{#translate}}If checked then do not send a confirmation message that states the subscriber is now subscribed or unsubscribed. This does not disable double opt-in messages.{{/translate}}</span>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="ua-code" class="col-sm-2 control-label">{{#translate}}Tracking ID{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="ua-code" id="ua-code-url" placeholder="UA-XXXXX-XX" value="{{uaCode}}">
<span class="help-block">{{#translate}}Enter Google Analytics tracking code{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="shoutout" class="col-sm-2 control-label">{{#translate}}Frontpage shout out{{/translate}}</label>
<div class="col-sm-10">
<textarea class="form-control gpg-text" rows="3" id="shoutout" name="shoutout" placeholder="">{{shoutout}}</textarea>
<span class="help-block">{{#translate}}HTML code shown in the front page header section{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="x-mailer" class="col-sm-2 control-label">{{#translate}}X-Mailer header{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="x-mailer" id="x-mailer" value="{{xMailer}}">
<span class="help-block">{{#translate}}Set a custom X-Mailer header value or leave empty to disable it{{/translate}}</span>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{#translate}}Campaign defaults{{/translate}}
</legend>
<div class="form-group">
<label for="default-sender" class="col-sm-2 control-label">{{#translate}}Sender name{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="default-sender" id="default-sender" value="{{defaultSender}}" placeholder="{{#translate}}Sender name, eg. My Awesome Company Ltd.{{/translate}}">
</div>
</div>
<div class="form-group">
<label for="default-postaddress" class="col-sm-2 control-label">{{#translate}}Default address{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="default-postaddress" id="default-postaddress" value="{{defaultPostaddress}}" placeholder="{{#translate}}Contact address to provide, eg. 1234 Main Street, Anywhere, MA 01234, USA{{/translate}}">
</div>
</div>
<hr />
<div class="form-group">
<label for="default-from" class="col-sm-2 control-label">{{#translate}}Default "from name"{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="default-from" id="default-from" value="{{defaultFrom}}" placeholder="{{#translate}}This is the name your emails will come from{{/translate}}" required>
</div>
</div>
<div class="form-group">
<label for="default-address" class="col-sm-2 control-label">{{#translate}}Default "from" email{{/translate}}</label>
<div class="col-sm-10">
<input type="email" class="form-control" name="default-address" id="default-address" value="{{defaultAddress}}" placeholder="{{#translate}}This is the address people will send replies to{{/translate}}" required>
</div>
</div>
<div class="form-group">
<label for="default-subject" class="col-sm-2 control-label">{{#translate}}Default "subject line"{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="default-subject" id="default-subject" value="{{defaultSubject}}" placeholder="{{#translate}}Keep it relevant and non-spammy{{/translate}}">
</div>
</div>
<div class="form-group">
<label for="default-homepage" class="col-sm-2 control-label">{{#translate}}Default homepage (URL){{/translate}}</label>
<div class="col-sm-10">
<input type="url" class="form-control" name="default-homepage" id="default-homepage" value="{{defaultHomepage}}" placeholder="{{#translate}}URL to redirect the subscribed users to, eg. http://example.com/{{/translate}}">
<span class="help-block">&nbsp;</span>
</div>
</div>
<div class="form-group">
<label for="default-unsubscribe" class="col-sm-2 control-label">{{#translate}}Default custom unsubscribe (URL)){{/translate}}</label>
<div class="col-sm-10">
<input type="url" class="form-control" name="default-unsubscribe" id="default-unsubscribe" value="{{defaultUnsubscribe}}" placeholder="{{#translate}}Custom unsubscribe URL, eg. http://example.com/unsubscribe/[EMAIL]{{/translate}}">
<span class="help-block">{{#translate}}Set a custom unsubscribe url.{{/translate}}</span>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{#translate}}Mailer Settings{{/translate}}
</legend>
<p class="text-info">{{#translate}}These settings are required to send out e-mail messages{{/translate}}</p>
<div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="{{#if useSMTP}} active {{/if}}"><a href="#smtp-settings" aria-controls="smtp-settings" role="tab" data-toggle="tab">{{#translate}}SMTP{{/translate}}</a></li>
<li role="presentation" class="{{#if useSES}} active {{/if}}"><a href="#aws-ses" aria-controls="aws-ses" role="tab" data-toggle="tab">{{#translate}}AWS SES{{/translate}}</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane {{#if useSMTP}} active {{/if}}" id="smtp-settings">
<p></p>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="radio">
<label>
<input type="radio" name="mail-transport" id="transport-smtp" value="smtp" {{#if useSMTP}} checked {{/if}}>
{{#translate}}Use SMTP for sending mail{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="smtp-hostname" class="col-sm-2 control-label">{{#translate}}Hostname{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="smtp-hostname" id="smtp-hostname" placeholder="Hostname, eg. smtp.example.com" value="{{smtpHostname}}" required>
</div>
</div>
<div class="form-group">
<label for="smtp-port" class="col-sm-2 control-label">{{#translate}}Port{{/translate}}</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="smtp-port" id="smtp-port" placeholder="{{#translate}}Port, eg. 465. Autodetected if left blank{{/translate}}" value="{{smtpPort}}">
</div>
</div>
<div class="form-group">
<label for="smtp-encryption" class="col-sm-2 control-label">{{#translate}}Encryption{{/translate}}</label>
<div class="col-sm-10">
<select class="form-control" id="smtp-encryption" name="smtp-encryption">
{{#each smtpEncryption}}
<option value="{{key}}" {{#if checked}} selected {{/if}}>
{{value}}
{{#if description}} <span class="text-muted"> &mdash; {{description}}</span>{{/if}}
</option>
{{/each}}
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="checkbox">
<label>
<input type="checkbox" name="smtp-disable-auth" {{#if smtpDisableAuth}} checked {{/if}}> {{#translate}}Disable SMTP authentication{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="smtp-user" class="col-sm-2 control-label">{{#translate}}Username{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="smtp-user" id="smtp-user" placeholder="{{#translate}}Username, eg. myaccount@example.com{{/translate}}" value="{{smtpUser}}">
</div>
</div>
<div class="form-group">
<label for="smtp-pass" class="col-sm-2 control-label">{{#translate}}Password{{/translate}}</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="smtp-pass" id="smtp-pass" placeholder="{{#translate}}Password{{/translate}}" value="{{smtpPass}}">
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane {{#if useSES}} active {{/if}}" id="aws-ses">
<p></p>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="radio">
<label>
<input type="radio" name="mail-transport" id="transport-ses" value="ses" {{#if useSES}} checked {{/if}}>
{{#translate}}Use SES API for sending mail{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="ses-key" class="col-sm-2 control-label">{{#translate}}Access Key{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="ses-key" id="ses-key" placeholder="{{#translate}}AWS Access Key Id{{/translate}}" value="{{sesKey}}">
</div>
</div>
<div class="form-group">
<label for="ses-secret" class="col-sm-2 control-label">{{#translate}}Secret Key{{/translate}}</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="ses-secret" id="ses-secret" placeholder="{{#translate}}AWS Secret Access Key{{/translate}}" value="{{sesSecret}}">
</div>
</div>
<div class="form-group">
<label for="ses-region" class="col-sm-2 control-label">{{#translate}}Region{{/translate}}</label>
<div class="col-sm-10">
<select class="form-control" id="ses-region" name="ses-region">
{{#each sesRegion}}
<option value="{{key}}" {{#if checked}} selected {{/if}}>
{{value}}
</option>
{{/each}}
</select>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="text-right">
<button type="submit" id="verify-button" form="smtp-verify" class="btn btn-info" data-loading-text="{{#translate}}Checking{{/translate}}…"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> {{#translate}}Check Mailer config{{/translate}}</button>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{#translate}}Advanced Mailer settings{{/translate}}
</legend>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="checkbox">
<label>
<input type="checkbox" name="smtp-log" {{#if smtpLog}} checked {{/if}}> {{#translate}}Log SMTP transactions{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="checkbox">
<label>
<input type="checkbox" name="smtp-self-signed" {{#if smtpSelfSigned}} checked {{/if}}> {{#translate}}Allow self-signed certificates{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="smtp-max-connections" class="col-sm-2 control-label">{{#translate}}Max connections{{/translate}}</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="smtp-max-connections" id="smtp-max-connections" placeholder="{{#translate}}The count of max connections, eg. 10{{/translate}}" value="{{smtpMaxConnections}}">
<span class="help-block">{{#translate}}The count of maximum simultaneous connections to make against the SMTP server (defaults to 5). This limit is per sending process.{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="smtp-max-messages" class="col-sm-2 control-label">{{#translate}}Max messages{{/translate}}</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="smtp-max-messages" id="smtp-max-messages" placeholder="{{#translate}}The count of max messages, eg. 100{{/translate}}" value="{{smtpMaxMessages}}">
<span class="help-block">{{#translate}}The number of messages to send through a single connection before the connection is closed and reopened (defaults to 100){{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="smtp-throttling" class="col-sm-2 control-label">{{#translate}}Throttling{{/translate}}</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="smtp-throttling" id="smtp-throttling" placeholder="{{#translate}}Messages per hour eg. 1000{{/translate}}" value="{{smtpThrottling}}">
<span class="help-block">{{#translate}}Maximum number of messages to send in an hour. Leave empty or zero for no throttling. If your provider uses a different speed limit (messages/minute or messages/second) then convert this limit into messages/hour (1m/s => 3600m/h). This limit is per sending process.{{/translate}}</span>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{#translate}}VERP bounce handling{{/translate}}
</legend>
<p class="text-info">
{{#translate}}Mailtrain is able to use VERP based routing to detect bounces. In this case the message is sent to the recipient using a custom VERP address as the return path of the message. If the message is not accepted a bounce email is sent to this special VERP address and thus a bounce is detected.{{/translate}}
</p>
<p class="text-info">
{{#translate}}To get VERP working you need to set up a DNS MX record that points to your Mailtrain hostname. You must also ensure that Mailtrain VERP interface is available from port 25 of your server (port 25 usually requires root user privileges). This way if anyone tries to send email to someuser@verp-hostname then the email should end up to this server.{{/translate}}
</p>
<p class="text-warning">
{{#translate}}VERP usually only works if you are using your own SMTP server. Regular relay services (SES, SparkPost, Gmail etc.) tend to remove the VERP address from the message.{{/translate}}
</p>
{{#if verpEnabled}}
<div class="form-group">
<div class="col-sm-offset-2 col-xs-4">
<div class="checkbox">
<label>
<input type="checkbox" name="verp-use" {{#if verpUse}} checked {{/if}}> {{#translate}}Use VERP to catch bounces{{/translate}}
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="verp-hostname" class="col-sm-2 control-label">{{#translate}}Server hostname{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="verp-hostname" id="verp-hostname" placeholder="{{#translate}}The VERP server hostname, eg. bounces.example.com{{/translate}}" value="{{verpHostname}}">
<span class="help-block">{{#translate}}VERP bounce handling server hostname. This hostname is used in the SMTP envelope FROM address and the MX DNS records should point to this server{{/translate}}</span>
</div>
</div>
{{else}}
<div class="form-group">
<div class="col-sm-10">
<p class="form-control-static">{{#translate}}VERP bounce handling server is not enabled. Modify your server configuration file and restart server to enable it{{/translate}}</p>
</div>
</div>
{{/if}}
</fieldset>
<fieldset>
<legend>
{{#translate}}GPG Signing{{/translate}}
</legend>
<p>
{{#translate}}Only messages that are encrypted can be signed. Subsribers who have not set up a GPG public key in their profile receive normal email messages. Users with GPG key set receive encrypted messages and if you have signing key also set, the messages are signed with this key.{{/translate}}
</p>
<p class="text-warning">
{{#translate}}Do not use sensitive keys here. The private key and passphrase are not encrypted in the database.{{/translate}}
</p>
<div class="form-group">
<label for="pgp-passphrase" class="col-sm-2 control-label">{{#translate}}Private Key Passphrase{{/translate}}</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="pgp-passphrase" id="pgp-passphrase" placeholder="{{#translate}}Passphrase for the key if set{{/translate}}" value="{{pgpPassphrase}}">
<span class="help-block">{{#translate}}Only fill this if your private key is encrypted with a passphrase{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="pgp-private-key" class="col-sm-2 control-label">{{#translate}}GPG Private Key{{/translate}}</label>
<div class="col-sm-10">
<textarea class="form-control gpg-text" rows="3" id="pgp-private-key" name="pgp-private-key" placeholder="{{#translate}}Begins with{{/translate}} &#39;-----BEGIN PGP PRIVATE KEY BLOCK-----&#39;">{{pgpPrivateKey}}</textarea>
<span class="help-block">{{#translate}}This value is optional. If you do not provide a private key GPG encrypted messages are sent without signing.{{/translate}}</span>
</div>
</div>
</fieldset>
<fieldset>
<legend>
{{#translate}}DKIM Signing by ZoneMTA{{/translate}}
</legend>
<p>
{{#translate}}If you are using ZoneMTA then Mailtrain can provide a DKIM key for signing all outgoing messages. Other services usually provide their own means to DKIM sign your messages{{/translate}}
</p>
<p class="text-warning">
{{#translate}}Do not use sensitive keys here. The private key is not encrypted in the database.{{/translate}}
</p>
<div class="form-group">
<label for="pgp-passphrase" class="col-sm-2 control-label">{{#translate}}ZoneMTA DKIM API Key{{/translate}}</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="dkim-api-key" id="dkim-api-key" placeholder="{{#translate}}Some secret value{{/translate}}" value="{{dkimApiKey}}">
<span class="help-block">{{#translate}}Secret value known to ZoneMTA for requesting DKIM key information. If this value was generated by the Mailtrain installation script then you can keep it as it is{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="pgp-passphrase" class="col-sm-2 control-label">{{#translate}}DKIM domain{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="dkim-domain" id="dkim-domain" placeholder="{{#translate}}Domain name for the DKIM key{{/translate}}" value="{{dkimDomain}}">
<span class="help-block">{{#translate}}Leave blank to use the sender email address domain{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="pgp-passphrase" class="col-sm-2 control-label">{{#translate}}DKIM key selector{{/translate}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="dkim-selector" id="dkim-selector" placeholder="{{#translate}}DKIM key selector{{/translate}}" value="{{dkimSelector}}">
<span class="help-block">{{#translate}}Signing is disabled without a valid selector value{{/translate}}</span>
</div>
</div>
<div class="form-group">
<label for="dkim-private-key" class="col-sm-2 control-label">{{#translate}}DKIM Private Key{{/translate}}</label>
<div class="col-sm-10">
<textarea class="form-control gpg-text" rows="3" id="dkim-private-key" name="dkim-private-key" placeholder="{{#translate}}Begins with{{/translate}} &#39;-----BEGIN RSA PRIVATE KEY-----&#39;">{{dkimPrivateKey}}</textarea>
<span class="help-block">{{#translate}}This value is optional. If you do not provide a private key then messages are not signed.{{/translate}}</span>
</div>
</div>
</fieldset>
<hr />
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-ok"></i> {{#translate}}Update{{/translate}}</button>
</div>
</div>
</form>