SendMail
Introduction and overview
The SendMail AuthState is a generic AuthState to send e-mails.
Description
The following table describes the characteristics of the AuthState.
Topic | Description |
---|---|
Class | ch.nevis.esauth.auth.states.mail.SendMail |
Logging | StdStates |
Auditing | none |
Properties | smtpHost (string, -)The host of the SMTP server. |
smtpPort (int, 25)The port number of the SMTP server. | |
smtpUser (string, -)The user used for authentication on the SMTP server. | |
Properties | smtpPass (string, -)The passphrase used for authentication on the SMTP server. |
subject (string, -)The subject of the e-mail. Expressions will be substituted during the request. | |
body (string, -)The body of the e-mail. Expressions will be substituted during the request. | |
sender (string, -)The sender of the e-mail. Expressions will be substituted during the request.. | |
receivers (string, -)Comma-, semicolon- or space-separated list of receivers. Expressions will be substituted during the request. | |
contentType (string, "text/plain")The content type of the e-mail body. | |
Methods | process (all events) |
Input | none (except over variable substitution) |
Transitions | ok: if sending was successful |
sendFailed (optional): If an error happened during sending. | |
default: If an error happened. | |
Errors | AUTH_FAILED if sending of the email failed and no sendFailed transition is configured. |
Example
<AuthState name="SendMail"
class="ch.nevis.esauth.auth.states.standard.SendMail" final="false">
<ResultCond name="default" next="AuthError" />
<ResultCond name="ok" next="DoMoreStuff" />
<Response value="AUTH_ERROR">
<Gui name="AuthErrorDialog"/>
</Response>
<property name="smtpHost" value="smtp.gmail.com" />
<property name="smtpPort" value="543" />
<property name="smtpUser" value="[email protected]" />
<property name="smtpPass" value="secret" />
<property name="subject" value="Welcome ${request:userId}" />
<property name="body" value="${notes:template}" />
<property name="sender" value="[email protected]" />
<property name="receivers" value="${notes:email}" />
</AuthState>