r1 - 14 Apr 2007 - 19:04:38 - TWikiContributorYou are here: TWiki >  TWiki Web > SendEmailPlugin

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: lae2@psu_NOSPAM_.edu)
  • 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.

To:

CC:

Subject:

Message:

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 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)
    • Set DEBUG = 0

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.

Topic attachments
I Attachment Action Size Date Who Comment
elsecss sendemailplugin.css manage 0.3 K 14 May 2007 - 14:39 TWikiContributor CSS styles
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.SendEmailPlugin