Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
replace absolute viewpath to encoded plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
Qoraiche committed Mar 26, 2019
1 parent b822aad commit b379ccd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions resources/views/sections/edit-mailable-template.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ function setTableComponent(editor) {
if (typeof plaintextEditor !== 'undefined' && plaintextEditor.getValue() !== ''){
axios.post('{{ route('parseTemplate') }}', {
markdown: plaintextEditor.getValue(),
viewpath: "{{ $templateData['text_view_path'] }}"
viewpath: "{{ base64_encode($templateData['text_view_path']) }}"
})
}
axios.post('{{ route('parseTemplate') }}', {
markdown: simplemde.codemirror.getValue(),
viewpath: "{{ $templateData['view_path'] }}"
viewpath: "{{ base64_encode($templateData['view_path']) }}"
})
.then(function (response) {
Expand Down Expand Up @@ -502,13 +502,13 @@ function viewMarkdownParser(plainText){
if (typeof plaintextEditor !== 'undefined' && plaintextEditor.getValue() !== ''){
axios.post('{{ route('parseTemplate') }}', {
markdown: plaintextEditor.getValue(),
viewpath: "{{ $templateData['text_view_path'] }}"
viewpath: "{{ base64_encode($templateData['text_view_path']) }}"
})
}
axios.post('{{ route('parseTemplate') }}', {
markdown: tinymce.get('template_editor').getContent(),
viewpath: "{{ $templateData['view_path'] }}"
viewpath: "{{ base64_encode($templateData['view_path']) }}"
})
.then(function (response) {
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/MailablesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function parseTemplate(Request $request)

$template = $request->has('template') ? $request->template : false;

if( mailEclipse::markdownedTemplateToView(true, $request->markdown, $request->viewpath, $template) ){
if( mailEclipse::markdownedTemplateToView(true, $request->markdown, base64_decode($request->viewpath), $template) ){

return response()->json([
'status' => 'ok',
Expand Down

0 comments on commit b379ccd

Please sign in to comment.