Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apex_micro_site
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Ali Arshad
apex_micro_site
Commits
d6d6e824
Commit
d6d6e824
authored
Feb 14, 2018
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
email configuration done
parent
886d09eb
Pipeline
#309
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
1 deletions
+114
-1
lms-setting.php
.../wp-content/plugins/apex_global_lms/admin/lms-setting.php
+87
-1
order-redirection.php
...nt/plugins/apex_global_lms/template/order-redirection.php
+27
-0
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/admin/lms-setting.php
View file @
d6d6e824
...
@@ -5,6 +5,92 @@ add_action('admin_menu', 'vq_lms_settings_page');
...
@@ -5,6 +5,92 @@ add_action('admin_menu', 'vq_lms_settings_page');
add_action
(
'admin_init'
,
'vq_lms_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_payment_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_payment_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_email_settings_init'
);
function
vq_lms_email_settings_init
()
{
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_email_subject'
);
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_email_template'
);
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_notify_email'
);
add_settings_section
(
'vq_lms_email_settings_section'
,
'Email Notification Settings'
,
'vq_lms_email_settings_section_cb'
,
'vq_lms_settings'
);
add_settings_field
(
'vq_lms_payment_email_subject'
,
'Email Subject'
,
'vq_lms_payment_email_subject_cb'
,
'vq_lms_settings'
,
'vq_lms_email_settings_section'
);
add_settings_field
(
'vq_lms_payment_email_template'
,
'Email Template'
,
'vq_lms_payment_email_template_cb'
,
'vq_lms_settings'
,
'vq_lms_email_settings_section'
);
add_settings_field
(
'vq_lms_payment_notify_email'
,
'Notify URL'
,
'vq_lms_payment_notify_email_cb'
,
'vq_lms_settings'
,
'vq_lms_email_settings_section'
);
}
function
vq_lms_email_settings_section_cb
()
{
echo
"Enter Email configuration on order placement"
;
}
function
vq_lms_payment_email_template_cb
()
{
$options
=
get_option
(
'vq_lms_payment_email_template'
);
wp_editor
(
$options
,
'vq_lms_payment_email_template'
,
array
(
'textarea_rows'
=>
10
));
?>
<p
class=
"description"
>
Use [[ORDER_DETAILS]] for Order Details
</p>
<?php
?>
<p
class=
"description"
>
Use [[PRICE]] for Price
</p>
<?php
?>
<p
class=
"description"
>
Use [[STATUS]] for Status
</p>
<?php
?>
<p
class=
"description"
>
Use [[RESPONSE]] for Response
</p>
<?php
}
function
vq_lms_payment_notify_email_cb
()
{
$option
=
get_option
(
'vq_lms_payment_notify_email'
);
?>
<input
type=
"email"
name=
"vq_lms_payment_notify_email"
value=
"
<?php
echo
$option
;
?>
"
>
<p
class=
"description"
>
You will be notified on this URL when an order is placed.
</p>
<?php
}
function
vq_lms_payment_email_subject_cb
()
{
$option
=
get_option
(
'vq_lms_payment_email_subject'
);
?>
<input
type=
"text"
name=
"vq_lms_payment_email_subject"
value=
"
<?php
echo
$option
;
?>
"
>
<p
class=
"description"
>
Subject Email
</p>
<?php
}
function
vq_lms_payment_settings_init
()
function
vq_lms_payment_settings_init
()
...
@@ -317,7 +403,7 @@ function vq_lms_settings_page()
...
@@ -317,7 +403,7 @@ function vq_lms_settings_page()
{
{
add_submenu_page
(
'edit.php?post_type=vq_course'
,
add_submenu_page
(
'edit.php?post_type=vq_course'
,
'
Test Page
'
,
'
Settings
'
,
'Settings'
,
'Settings'
,
'manage_options'
,
'manage_options'
,
'vq_lms_settings'
,
'vq_lms_settings'
,
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/order-redirection.php
View file @
d6d6e824
...
@@ -31,6 +31,33 @@ if($data && (string) $req_id === (string) $data->application->request_id) {
...
@@ -31,6 +31,33 @@ if($data && (string) $req_id === (string) $data->application->request_id) {
update_post_meta
(
$order_id
,
'signature'
,
(
string
)
$data
->
application
->
signature
);
update_post_meta
(
$order_id
,
'signature'
,
(
string
)
$data
->
application
->
signature
);
update_post_meta
(
$order_id
,
'request_id'
,
(
string
)
$data
->
application
->
request_id
);
update_post_meta
(
$order_id
,
'request_id'
,
(
string
)
$data
->
application
->
request_id
);
update_post_meta
(
$order_id
,
'response_id'
,(
string
)
$data
->
application
->
response_id
);
update_post_meta
(
$order_id
,
'response_id'
,(
string
)
$data
->
application
->
response_id
);
/* Email Configuration */
$to
=
get_option
(
'vq_lms_payment_notify_email'
);
$sub
=
get_option
(
'vq_lms_payment_email_subject'
);
$body
=
get_option
(
'vq_lms_payment_email_template'
);
$content
=
get_the_content
(
$order_id
);
$price
=
get_post_meta
(
$order_id
,
'total_amount'
,
true
);
$status
=
get_post_meta
(
$order_id
,
'payment_status'
,
true
);
$pmsg
=
get_post_meta
(
$order_id
,
'payment_message'
,
true
);
$body
=
str_replace
(
'[[ORDER_DETAILS]]'
,
$content
,
$body
);
$body
=
str_replace
(
'[[PRICE]]'
,
$price
,
$body
);
$body
=
str_replace
(
'[[STATUS]]'
,
$status
,
$body
);
$body
=
str_replace
(
'[[RESPONSE]]'
,
$pmsg
,
$body
);
if
(
wp_mail
(
$to
,
$sub
,
$body
))
{
update_post_meta
(
$order_id
,
'email_status'
,
1
);
}
else
{
update_post_meta
(
$order_id
,
'email_status'
,
0
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment