> > Send Email Plugin
<--
Contributions to this plugin are appreciated. Please update the plugin page at
http://twiki.org/cgi-bin/view/Plugins/SendEmailPlugin or provide feedback at
http://twiki.org/cgi-bin/view/Plugins/SendEmailPluginDev .
If you are a TWiki contributor please update the plugin in the SVN repository.
-->
Send e-mails via a web form
Overview
Allows to send e-mails through an e-mail form.
Usage
Create a form on the page that invokes the sendemail
script
Add a "to" field and a submit button
Make sure to fill in allowed 'to' addresses in setting {Plugins}{SendEmailPlugin}{Permissions}{Allow}{MailTo}
in configure
<--/twistyPlugin twikiMakeVisibleInline-->
<form enctype="application/x-www-form-urlencoded" name="mailform" action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%" method="POST">
<input type="hidden" name="subject" value="hello!" />
<input type="hidden" name="body" value="howdy!" />
<input type="text" class="twikiInputField" name="to" size="30" />
<input type="submit" class="twikiSubmit" value="Send" />
</form>
<--/twistyPlugin-->
%SENDEMAIL%
<--
Notification
%SENDEMAIL%
-->
Example with FormPlugin
This form asks for user information and validates that the password confirmation matches the password.
<--/twistyPlugin twikiMakeVisibleInline-->
%STARTFORM{
name="mailForm"
action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%"
method="POST"
onSubmit="return checkPasswords(this)"
}%
<fieldset style="border:1px solid #ddd; padding:1em">
<legend><b>Send Email</b></legend>
%RED%*%ENDCOLOR% All fields are required.
%FORMELEMENT{
name="To"
type="hidden"
title="To:"
default="me@myurl.com"
}%
%FORMELEMENT{
name="Subject"
type="hidden"
default="Account Request"
}%
%FORMELEMENT{
name="Name"
type="text"
mandatory="on"
title="Name (First and Last):"
}%
%FORMELEMENT{
name="Email"
type="text"
mandatory="on"
validate="email"
title="E-mail Address:"
}%
%FORMELEMENT{
name="Password"
type="password"
mandatory="on"
title="Password (caps sensitive):"
}%
%FORMELEMENT{
name="Confirm"
type="password"
mandatory="on"
title="Confirm your password:"
}%
%FORMELEMENT{
name="body"
type="textarea"
rows="10"
cols="80"
cssclass="twikiHidden"
default="$Name
$Email
$Company
$Password
$Confirm"
}%
%FORMELEMENT{
type="submit"
buttonlabel="Send"
}%
</fieldset>
%ENDFORM%
%SENDEMAIL{feedbackSuccess="Request sent, we'll contact you shortly." feedbackError="Could not send your message, please contact us." }%
<script type="text/javascript">
//<![CDATA[
function checkPasswords(inForm) {
if(inForm.Password.value != inForm.Confirm.value) {
alert('Your passwords do not match. Please try again.');
return false;
}
return true;
}
//]]>
</script>
<--/twistyPlugin-->
The following form is disabled because only the first SendEmailPlugin form on a topic works. This is the third.
<--FormPlugin form start-->
<--/FormPlugin form end-->
%SENDEMAIL{feedbackSuccess="Request sent, we'll contact you shortly." feedbackError="Could not send your message, please contact us." }%
FAQ
How do I send data form fields?
If you have a TWiki form with the fields Title
and Summary
and want to post the values of these fields in the body of the e-mail, eiter:
put them in a hidden field:
<input type="hidden" name="body" value="Title: %FORMFIELD{"Title"}%, Summary: %FORMFIELD{"Summary"}%" />
preserve linebreaks by putting them in a textarea:
<textarea name="body" class="twikiHidden" cols="80" rows="6">
Title: %FORMFIELD{"Title"}%
Summary: %FORMFIELD{"Summary"}%
</textarea>
Plugin test
SendEmailPlugin is not enabled .
Plugin Settings
<--
Set SHORTDESCRIPTION = Send e-mails via a web form
-->
Plugin settings are set in configure .
Note: by default any emailing is prohibited. Change the settings in configure to set to which addresses you allow mails to be sent from and to.
CSS classes
HTML elements with these style names are written to the default feedback.
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 extension. The following instructions are for the administrator who installs the extension on the TWiki server.
For an automated installation , run the configure script and follow "Find More Extensions" in the in the Extensions section.
Or, follow these manual installation steps:
Download the ZIP file from the extension home on twiki.org (see below).
Unzip SendEmailPlugin.zip
in your twiki installation directory.
Set the ownership of the extracted directories and files to the webserver user.
Install the dependencies (if any).
Plugin configuration and testing :
Run the configure script and enable the plugin in the Plugins section.
Configure additional plugin settings in the Extensions section if needed.
Test if the installation was successful using the examples provided.
Plugin Info
Plugin Author:
TWiki:Main.ArthurClemens
Copyright:
© 2007-2010 Arthur Clemens; 2008 Michael Daum © 2007-2013 TWiki:TWiki.TWikiContributor
License:
GPL (GNU General Public License )
Plugin Version:
2013-05-28
Change History:
<-- versions below in reverse order -->
2013-05-28:
Twikubg:Item7268: HTML email support
2013-04-24:
TWikibug:Item7239 : Shortcomings in template handling and documentation are fixed
2013-04-23:
TWikibug:Item7237 : Config parameter inconsistency fix
2013-01-24:
TWikibug:Item7129 : TWiki.SendEmailPlugin 2nd and 3rd email forms are bound to fail
2013-01-24:
TWikibug:Item7045 : Make SendEmailPlugin hiding URL "get" parameters when rediecting to a target page.
2012-11-21:
TWikibug:Item7048 : Block the "from" field for security purpose.
2012-11-21:
TWikibug:Item7047 : Configure retry times in config file.
2012-11-21:
TWikibug:Item7046 : SendEmailPlugin doesn't expand variables in an email template
2011-04-02:
TWikibug:Item6676 : Plugin update 2010 from related project and doc improvements
28 Feb 2010
1.5.1 Added forgotten Config.spec
file.
08 Jan 2010
1.5 Arthur Clemens: Improved error feedback; added format
parameter; moved the mail template to a topic; changed param template
to mailtemplate
.
03 Jan 2010
1.4.2 Arthur Clemens: Added configure settings to download.
29 Mar 2009
1.4.1 Arthur Clemens: Removed default restrictions in Deny
settings so that only the Allow
setting needs to be set to send emails.
21 Mar 2009
1.4 Arthur Clemens: Moved topic and hardcoded settings to configure.
06 Nov 2008
1.2.3 Michael Daum: Fixed CC emails; fixed css in docu
17 Oct 2008
1.2.1 Michael Daum: Added support for TWiki-5; fixed sending emails to login names
26 Jun 2008
1.2.0 Michael Daum: Added ALLOW/DENY preference settings to prevent this plugin from being used as an open spam relay; added template
option allowing more control over email header etc; fixed mod_perl/perperl coding errors; sender address is the current user, it will default to the wikimaster's only as a last resort; allow user names in addition to plain email addresses in From, To and Cc; allow multiple users in To and Cc; added a redirectto
, successsection
and errorsection
options to land on a different feedback page; reorganized code for lazy compilation
16 may 2007
1.1.3 Arthur Clemens: Fixed bug in bin script that caused form query data to get emptied.
15 may 2007
1.1.2 Arthur Clemens: Improved error notifications.
13 May 2007
1.1.1 Arthur Clemens: Changed sendmail script invocation to be called through bin script sendemail
; added CSS styles for feedback notification; fixed typo 'feedbackSucces'.
05 May 2007
1.0 First release.
TWiki Dependency:
4.2 or later
CPAN Dependencies:
none
Other Dependencies:
none
Perl Version:
5.005
Plugin Home:
http://TWiki.org/cgi-bin/view/Plugins/SendEmailPlugin
Feedback:
http://TWiki.org/cgi-bin/view/Plugins/SendEmailPluginDev
Appraisal:
http://TWiki.org/cgi-bin/view/Plugins/SendEmailPluginAppraisal
Related Topics: SendEmailPluginTemplate , SendEmailPluginExpandedTemplate , AdminDocumentationCategory , TWikiPreferences , TWikiPlugins
META FILEATTACHMENT
attachment="screenshot.png" attr="h" comment="" date="1301804660" name="screenshot.png" path="screenshot.png" size="20021" user="TWikiContributor" version="1"
META FILEATTACHMENT
attachment="sendemailplugin.css" attr="h" comment="" date="1237669972" name="sendemailplugin.css" path="sendemailplugin.css" size="350" user="TWikiContributor" version="1"