Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
89864faf
authored
2019-02-13 15:15:11 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
css for email
1 parent
aac7a130
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
com/Notifications/Admin.php
com/Notifications/views/create.php
com/Notifications/Admin.php
View file @
89864fa
...
...
@@ -68,12 +68,12 @@ function display_page()
$type
=
$_POST
[
'type'
];
$title
=
$_POST
[
'title'
];
$sendto
=
$_POST
[
'sendto'
];
$executeDate
=
(
$type
==
'scheduled'
)
?
$_POST
[
'execute_date'
]
:
'0000-00-00 00:00:00'
;
$trigger
=
(
$type
==
'scheduled'
)
?
'scheduled-cron-job'
:
$_POST
[
'trigger'
];
$executeDate
=
(
$type
==
'scheduled'
||
$type
==
'newsletter'
)
?
$_POST
[
'execute_date'
]
:
'0000-00-00 00:00:00'
;
$trigger
=
(
$type
==
'scheduled'
||
$type
==
'newsletter'
)
?
'scheduled-cron-job'
:
$_POST
[
'trigger'
];
$emailData
=
[];
$systemMessageData
=
[];
$style
=
$_POST
[
'email_style'
];
foreach
([
'en'
,
'fr'
]
as
$lang
)
{
// email
$subject
=
$_POST
[
$lang
.
'_subject'
];
...
...
@@ -127,7 +127,9 @@ function display_page()
'sendto'
=>
$sendto
,
'status'
=>
$entry
->
details
[
'status'
],
'trigger'
=>
$trigger
,
'execute_date'
=>
$executeDate
'execute_date'
=>
$executeDate
,
'style'
=>
$style
]
);
update_post_meta
(
$id
,
'send_status'
,
$entry
->
details
[
'status'
]);
...
...
@@ -138,6 +140,7 @@ function display_page()
update_post_meta
(
$id
,
'email'
,
$emailData
);
update_post_meta
(
$id
,
'system'
,
$systemMessageData
);
update_post_meta
(
$id
,
'style'
,
$style
);
$update
=
[];
$update
[
'ID'
]
=
$id
;
...
...
@@ -319,9 +322,9 @@ function create_notification()
$type
=
$_POST
[
'type'
];
$title
=
$_POST
[
'title'
];
$sendto
=
$_POST
[
'sendto'
];
$executeDate
=
(
$type
==
'scheduled'
)
?
$_POST
[
'execute_date'
]
:
'0000-00-00 00:00:00'
;
$trigger
=
(
$type
==
'scheduled'
)
?
'scheduled-cron-job'
:
$_POST
[
'trigger'
];
$executeDate
=
(
$type
==
'scheduled'
||
$type
==
'newsletter'
)
?
$_POST
[
'execute_date'
]
:
'0000-00-00 00:00:00'
;
$trigger
=
(
$type
==
'scheduled'
||
$type
==
'newsletter'
)
?
'scheduled-cron-job'
:
$_POST
[
'trigger'
];
$style
=
$_POST
[
'email_style'
];
$emailData
=
[];
$systemMessageData
=
[];
...
...
@@ -352,7 +355,7 @@ function create_notification()
[
$lang
.
'_subject'
=>
$subject
,
$lang
.
'_text'
=>
$text
,
$lang
.
'_html'
=>
$html
,
$lang
.
'_html'
=>
$
style
.
$
html
,
$lang
.
'_attachments'
=>
$attachments
]
);
...
...
@@ -383,7 +386,8 @@ function create_notification()
'sendto'
=>
$sendto
,
'status'
=>
'pending'
,
'trigger'
=>
$trigger
,
'execute_date'
=>
$executeDate
'execute_date'
=>
$executeDate
,
'style'
=>
$style
]
);
update_post_meta
(
$id
,
'send_status'
,
'pending'
);
...
...
@@ -394,6 +398,7 @@ function create_notification()
update_post_meta
(
$id
,
'trigger'
,
$trigger
);
update_post_meta
(
$id
,
'email'
,
$emailData
);
update_post_meta
(
$id
,
'style'
,
$style
);
update_post_meta
(
$id
,
'system'
,
$systemMessageData
);
$flash
=
"<strong>Notification Saved Successfully!</strong><br /><a href='/wp-admin/admin.php?page=notifications'>Click here</a> to view all notifications.</a>"
;
...
...
com/Notifications/views/create.php
View file @
89864fa
...
...
@@ -352,13 +352,16 @@ function getInputFormValues($validation, $name) {
}
else
if
(
type
==
"newsletter"
)
{
$
.
ajax
({
url
:
"http
s
://"
+
window
.
location
.
hostname
+
"/wp-content/themes/cbv/assets/css/custom-editor-style.css"
,
url
:
"http://"
+
window
.
location
.
hostname
+
"/wp-content/themes/cbv/assets/css/custom-editor-style.css"
,
dataType
:
"text"
,
success
:
function
(
result
)
{
var
style
=
'<style>'
+
result
+
'</style>'
;
$
(
tinymce
.
get
(
'en_html'
).
getBody
()).
html
(
style
+
header
+
footer
);
$
(
tinymce
.
get
(
'fr_html'
).
getBody
()).
html
(
style
+
header_fr
+
footer_fr
);
jQuery
(
"#tabs"
).
append
(
'<input type="hidden" id="email_style" name="email_style" class="wide-input-field" />'
);
jQuery
(
"#email_style"
).
val
(
'<style>'
+
result
+
'</style>'
);
}
});
...
...
@@ -368,7 +371,8 @@ function getInputFormValues($validation, $name) {
jQuery
(
".text_verson"
).
hide
();
jQuery
(
'.attachments'
).
hide
();
jQuery
(
'.scheduled_sendto'
).
show
();
$
(
tinymce
.
get
(
'en_html'
).
getBody
()).
html
(
header
+
footer
);
$
(
tinymce
.
get
(
'fr_html'
).
getBody
()).
html
(
header_fr
+
footer_fr
);
jQuery
(
'#execute_date'
).
datetimepicker
({
format
:
'Y-m-d, H:i'
,
...
...
Please
register
or
sign in
to post a comment