Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmailTemplateBody = map[string]string{
"en/registration_confirmation": `<html>
<body>
<p>
Please confirm your registration by clicking this
<a href="{{ .registration_url }}/ack/{{ .registration_id }}">link</a>
and providing the registration code <b><code>{{ .registration_code }}</code></b>
within the next 45 minutes. If you haven't done so, please re-register.
</p>
<p>The registation metadata follows:</p>
<ul style="list-style-type: disc">
<li>Session ID: {{ .session_id }}</li>
<li>Request ID: {{ .request_id }}</li>
<li>Username: <code>{{ .username }}</code></li>
<li>Email: <code>{{ .email }}</code></li>
<li>IP Address: <code>{{ .src_ip }}</code></li>
<li>Timestamp: {{ .timestamp }}</li>
</ul>
</body>
</html>`,
"en/registration_ready": `<html>
<body>
<p>
The following user successfully registered with the portal.
Please use management interface to approve or decline the registration.
</p>
<p>The registation metadata follows:</p>
<ul style="list-style-type: disc">
<li>Registration ID: {{ .registration_id }}</li>
<li>Registration URL: <code>{{ .registration_url }}</code></li>
<li>Session ID: {{ .session_id }}</li>
<li>Request ID: {{ .request_id }}</li>
<li>Username: <code>{{ .username }}</code></li>
<li>Email: <code>{{ .email }}</code></li>
<li>IP Address: <code>{{ .src_ip }}</code></li>
<li>Timestamp: {{ .timestamp }}</li>
</ul>
</body>
</html>`,
"en/registration_verdict": `<html>
<body>
<p>
{{- if eq .verdict "approved" -}}
Your registration has been approved.
You may now login with the username or email
address below.
{{- else -}}
Your registration has been declined.
{{- end -}}
</p>
<p>The registation metadata follows:</p>
<ul style="list-style-type: disc">
<li>Username: <code>{{ .username }}</code></li>
<li>Email: <code>{{ .email }}</code></li>
<li>Timestamp: {{ .timestamp }}</li>
</ul>
</body>
</html>`,
}
EmailTemplateBody stores email body templates.
View Source
var EmailTemplateSubject = map[string]string{
"en/registration_confirmation": `Registration Confirmation Required`,
"en/registration_ready": `Review User Registration`,
"en/registration_verdict": `{{- if eq .verdict "approved" -}}
User Registration Approved
{{- else -}}
User Registration Declined
{{- end -}}`,
}
EmailTemplateSubject stores email subject templates.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
EmailProviders []*EmailProvider `json:"email_providers,omitempty" xml:"email_providers,omitempty" yaml:"email_providers,omitempty"`
}
Config represents a collection of various messaging providers.
func (*Config) ExtractEmailProvider ¶ added in v1.0.13
func (cfg *Config) ExtractEmailProvider(s string) *EmailProvider
ExtractEmailProvider returns EmailProvider by name.
func (*Config) FindProvider ¶ added in v1.0.12
FindProvider search for Provider by name.
func (*Config) FindProviderCredentials ¶ added in v1.0.12
FindProviderCredentials search for Provider by name and then identifies the credentials used by the provider.
type EmailProvider ¶
type EmailProvider struct { Name string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"` Address string `json:"address,omitempty" xml:"address,omitempty" yaml:"address,omitempty"` Protocol string `json:"protocol,omitempty" xml:"protocol,omitempty" yaml:"protocol,omitempty"` Credentials string `json:"credentials,omitempty" xml:"credentials,omitempty" yaml:"credentials,omitempty"` SenderEmail string `json:"sender_email,omitempty" xml:"sender_email,omitempty" yaml:"sender_email,omitempty"` SenderName string `json:"sender_name,omitempty" xml:"sender_name,omitempty" yaml:"sender_name,omitempty"` Templates map[string]string `json:"templates,omitempty" xml:"templates,omitempty" yaml:"templates,omitempty"` Passwordless bool `json:"passwordless,omitempty" xml:"passwordless,omitempty" yaml:"passwordless,omitempty"` BlindCarbonCopy []string `json:"blind_carbon_copy,omitempty" xml:"blind_carbon_copy,omitempty" yaml:"blind_carbon_copy,omitempty"` }
EmailProvider represents email messaging provider.
func (*EmailProvider) Send ¶ added in v1.0.13
func (e *EmailProvider) Send(creds *credentials.Generic, rcpts []string, subj, body string) error
Send sends an email message.
func (*EmailProvider) Validate ¶
func (e *EmailProvider) Validate() error
Validate validates EmailProvider configuration.
Click to show internal directories.
Click to hide internal directories.