CMS
Version 3.9
test_email_form.inc
Go to the documentation of this file.
1
<?php
2
/**************************************************************
3
4
Copyright (c) 2010 Sonjara, Inc
5
6
Permission is hereby granted, free of charge, to any person
7
obtaining a copy of this software and associated documentation
8
files (the "Software"), to deal in the Software without
9
restriction, including without limitation the rights to use,
10
copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the
12
Software is furnished to do so, subject to the following
13
conditions:
14
15
The above copyright notice and this permission notice shall be
16
included in all copies or substantial portions of the Software.
17
18
Except as contained in this notice, the name(s) of the above
19
copyright holders shall not be used in advertising or otherwise
20
to promote the sale, use or other dealings in this Software
21
without prior written authorization.
22
23
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30
OTHER DEALINGS IN THE SOFTWARE.
31
32
*****************************************************************/
33
34
Fakoli::using
(
"email"
);
35
Fakoli::usingFeature
(
"auto_form"
);
36
37
$menu_item
=
"Send Test Email"
;
38
39
$email
=
new
Email
();
40
$email
->sender_email =
$config
[
"email_from"
];
41
$email
->subject =
"Test message from {$config["
sitename
"]}"
;
42
$email
->message =
"Test message."
;
43
44
$form
=
new
AutoForm(
$email
);
45
$form
->submitLabel =
"Send Email"
;
46
$form
->readonly(
"sender_email"
);
47
$form
->hide(
"sender_name"
);
48
$form
->annotate(
"recipient"
,
"Provide one or more recipient email addresses, separated by commas"
);
49
$form
->alias(
"recipient"
,
"Recipient(s)"
);
50
51
if
(
$method
==
"POST"
)
52
{
53
$email
->fromPOST();
54
55
$recipients
= explode(
","
,
$email
->recipient);
56
foreach
(
$recipients
as $recipient)
57
{
58
$handler
=
new
EmailHandler
($recipient,
$email
->subject,
$email
->message,
$email
->sender_email);
59
$handler
->send();
60
}
61
62
Fakoli::notify
(
"Message Sent"
);
63
}
64
65
$script
.=
$form
->writeScript();
66
$form
->drawForm();
67
?>
$handler
$handler
Definition:
event_form.inc:62
EmailHandler
Definition:
email_manager.inc:172
Email
Definition:
email.inc:53
Fakoli\usingFeature
static usingFeature()
Uses the specified framework feature(s).
Definition:
core.inc:388
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
Fakoli\notify
static notify($message, $blocking=false, $button="OK", $onClick="null")
Utility method to display a notification message to the user when the page has finished loading.
Definition:
core.inc:1198
$method
$method
Pull out a simple reference to the request method.
Definition:
core.inc:1573
$config
global $config
Definition:
import.inc:4
$recipients
$recipients
Definition:
recipients_dialog.inc:56
$form
$form
Definition:
test_email_form.inc:44
$menu_item
$menu_item
Definition:
test_email_form.inc:37
$email
$email
Definition:
test_email_form.inc:39
$script
if($method=="POST") $script
Definition:
test_email_form.inc:65
code
cms.sonjara.com
cms
components
email
admin
test_email_form.inc
Generated on Tue Mar 23 2021 15:36:12 for CMS by
1.9.1