Send Email Plugin
Allows to send e-mail through an e-mail form.
Usage
- Create a form on the page.
- Call
action script sendemail
-
action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%"
- Required is a field with
name="to"
- Optional are the fields
cc, subject and body
- Field
from may be used but by default the address of %WIKIWEBMASTER% is used (this is set to: webmaster@rhotkealumni.org)
- To show feedback write
%SENDEMAIL% anywhere on the page where the feedback should appear.
- Optionally pass parameters
feedbackSuccess and feedbackError. Default feedback messages are set below in Plugin Settings.
Example
Example form
This form only works if this plugin is enabled - see
Plugin Tests below to check this.
%SENDEMAIL%
Example usage
%SENDEMAIL{feedbackSuccess="Successfully sent" feedbackError="Something went wrong." }%
<form enctype="application/x-www-form-urlencoded" name="mailform" action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%" method="POST">
<p>To:<br /><input class="twikiInputField" id="to" name="to" size="30" type="text" value="" /></p>
<p>CC:<br /><input type="text" class="twikiInputField" id="cc" name="cc" size="30" value="" /></p>
<p>Subject:<br /><input type="text" class="twikiInputField" id="subject" name="subject" size="30" value="" /></p>
<p>Message:<br /><textarea class="twikiInputField" cols="80" name="body" rows="6"></textarea></p>
<p><input type="submit" class="twikiSubmit" value="Send message" %IF{"context SendEmailPluginEnabled" then='' else='disabled="disabled"'}% /></p>
</form>
Plugin Tests
- SendEmailPlugin is not enabled.
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%CACHECONTENTPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Allows to send e-mail through an e-mail form
- Default feedback messages:
- Set EMAIL_SENT_SUCCESS_MESSAGE = Email sent!
- Set EMAIL_SENT_ERROR_MESSAGE = Could not send email
- Debug plugin: (See output in
data/debug.txt)
CSS classes
| Class name | Note |
sendEmailPluginNotification | Used for feedback after sending a mail |
sendEmailPluginError | Styles sendEmailPluginNotification in case of an error |
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
SendEmailPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/SendEmailPlugin.txt | Plugin topic |
lib/TWiki/Plugins/SendEmailPlugin.pm | Plugin Perl module |
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins