qoraiche / laravel-mail-editor Goto Github PK
View Code? Open in Web Editor NEWMailEclipse :zap: Laravel Mail Editor
License: Other
MailEclipse :zap: Laravel Mail Editor
License: Other
@Qoraiche Thanks for this wonderful package, Is there a way to use a different table instead of the default users table, currently am not sure one can use the package without having users table, I tried it and I got unknown field name in users table. Thank you.
Every mailable I have as different properties and params added to it, but I keep getting the above error:
public $property;
public $tenant;
/**
* @param $certs
*/
public function __construct($property, $tenant)
{
$this->property = $property;
$this->tenant = $tenant;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$message = $this->markdown('emails.tenant.pack')->subject('Tenant Pack for ' . $this->property->address . ' is now ready');
return $message;
}
I want to make a button for activate account. but giving a variable give me error.
My variable is $link which look like (http://localhost/activate/ $token)
How to pass variable ?
Like the looks of this package so far! Great potential. :)
An idea that I just wanted to dump here.
It would be really cool if you could store the templates in the database and if this package never modified any files.
Using docker, source control (git) or most kinds of deploy kind of makes it a big no-no to change php-files (anything outside of the storage folder really).
Would that be possible?
Not able to update Templates. shown error 500
Using homestead
[2019-03-28 15:50:19] local.ERROR: : failed to open stream: Protocol error {"exception":"[object] (ErrorException(code: 0): : failed to open stream: Protocol error at /home/vagrant/VM/Projects/Web/ding-web/vendor/qoraiche/laravel-mail-editor/src/mailEclipse.php:360)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, ': failed to ope...', '/home/vagrant/V...', 360, Array)
#1 /home/vagrant/VM/Projects/Web/ding-web/vendor/qoraiche/laravel-mail-editor/src/mailEclipse.php(360): file_put_contents('r\\x89\\xA9\\x95\\xEB^R\\xC7\\xAB>\\xBA\\x1F\\x8AW', '<!DOCTYPE html ...')
#2 /home/vagrant/VM/Projects/Web/ding-web/vendor/qoraiche/laravel-mail-editor/src/Http/Controllers/MailablesController.php(89): qoraiche\\mailEclipse\\mailEclipse::markdownedTemplateToView(true, '<!DOCTYPE html ...', 'r\\x89\\xA9\\x95\\xEB^R\\xC7\\xAB>\\xBA\\x1F\\x8AW', true)
#3 [internal function]: qoraiche\\mailEclipse\\Http\\Controllers\\MailablesController->parseTemplate(Object(Illuminate\\Http\\Request))
#4 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#5 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('parseTemplate', Array)
#6 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(qoraiche\\mailEclipse\\Http\\Controllers\\MailablesController), 'parseTemplate')
#7 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController()
#8 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\\Routing\\Route->run()
#9 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#10 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#11 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(684): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#12 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(659): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#13 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#14 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(614): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#15 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#16 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#17 /home/vagrant/VM/Projects/Web/ding-web/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#18 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#19 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#20 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#21 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#22 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#23 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#24 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#25 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#26 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#27 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#29 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#30 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#31 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#32 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#33 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#34 /home/vagrant/VM/Projects/Web/ding-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#35 /home/vagrant/VM/Projects/Web/ding-web/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#36 {main}
"}
Thank you for developing such a great package, I'll try to contribute on some features in the next upcoming days
Also, regarding the docs you might consider using LaRecipe to write your docs
This doens't have to do with the package itself but the website of the package (https://maileclipse.io/) that is throwning a 500
error page.
Just that. I hope you (@Qoraiche ) can manage to fix it :)
LogicException : Unable to prepare route [maileclipse] for serialization. Uses Closure.
I think no further explanation is needed;)
hay
nice project!
but why limited only for emails ?
you could add custom notification (like text-plan as sms)
thank you
Hi!
First of all, thanks for the wonderful package! So I'm following the installation instructions, and hit an error on the second step, right after I run this:
php artisan vendor:publish --provider="qoraiche\mailEclipse\mailEclipseServiceProvider"
I checked the source code here in Github and it does indeed seems there's no templates folder in that path.
Apologies if I've overlooked this feature, but it would be nice to be able to see the raw HTML rather than just the WYSIWYG version, I'd like to use this as a way for marketing to make minor changes to templates without having to go through version control and this looks like it would work great, but it seems like it's tied to using the templates. Is this something you would consider adding? I imagine it would be a case of adding the button to the tinyMCE toolbar?
Thanks!
Hi again,
The templates are stored in :
vendor/qoraiche/laravel-mail-editor/resources/views/templates/
where vendor/* is ignored in git => So the result of that is that all your dev and changes in the templates will not be taken in the testing nor production environment !
And also template data is stored in a data table which is also not taken in the git.
Why not create a Templates directory within the app/Mail directory and store it there ?
I have installed the package it work fine. Except on crud with axios return status response 419.
I have check csrf in axios setting and i found it all is normaly.
i don't know why he didn't arrived to the functions (crud).
any help please.
thank you.
Hello @Qoraiche,
This package looks great. I did notice one issue. When it runs through each factory, it is creating and storing the items in the application's database and not a testing location like a sqlite DB or different database.
This might be what @kertul is referring to in #19.
Thank you,
Michael D.
Thanks for a really neat package.
I am running 5.8 and it seems its not compatible with this version yet?
"Class 'string' not found"
qoraiche/laravel-mail-editor/src/mailEclipse.php644
it seems this would not work if we have non object parameters in an existing mailable constructor?
It would be very useful if you could add a button for each mailable, in the mailables view, where you can specify an email (or possibly a user id) and have a test sent to that email.
The preview is nice, but you really don't know for sure how an email is going to look until you send an actual test and preview it in Mailtrap or in your email client itself (Gmail for example)
This would be a nice convenience method that I would personally use
Someone can help my for this error View [createmailable] not found.
PR ref: #13
To reproduce:
UI error:
Error: Request failed with status code 500
XHR response message:
message | Method Illuminate\Support\Collection::add does not exist.
file | qoraiche/mailEclipse/src/mailEclipse.php |
---|---|
line | 125 |
class | Illuminate\Support\Collection |
When I create a mailables project following the official website example, I will be prompted with an error when I open it:
Then I found that there were no from
and replyTo
keys in the $resource array of the blade template. When I changed the build
method of the mail class, it seemed to be back to normal again
This is a new laravel project. I don't know what caused the error
Hi,
Everytime I visit the 'maileclipse/mailables' path it creates a bunch of fake users.
Thanks for sharing this great package !
Setup new mailable template or markdown after change then template on edit mailable
Will or does this package allow for Laravel 6 which I believe is released tomorrow (3rd Sept)
good stuff!
A laravel nova package would be great!
How add views to versioning ?
First off; looks pretty awesome. I wanted to give it a run in my application (which has a lot of mailables), but straight away I get an error when I visit /maileclipse:
Too few arguments to function App\Mail\MailClass::__construct(), 0 passed in /Users/****/Workspace/****/vendor/qoraiche/laravel-mail-editor/src/mailEclipse.php on line 548 and at least 2 expected
The constructor of this class has 3 arguments available:
public function __construct($var1,$var2, $var3 = null)
{
}
I would debug it myself and PR it if I had the time. Still thanks for such a great package 👍
In my mailable contructor I have a typehint for int and it fails on that:
"Argument 1 passed to App\Mail\XXX::__construct() must be of the type int, object given"
Hi,
I am unable to view your documentation. Is there a different link which I should be looking at?
Hi there, thank u for this awesome package!
Creating template first time is hassle-free. After attaching mailable to the template, when I view the mailable, the editor is not working. In the console, I am getting this error:
Uncaught SyntaxError: Invalid hexadecimal escape sequence
Can you please help me?
Thank you for this excellent package. I installed it in a project using laravel 5.7 however when I do php artisan vendor:publish I don't have the views. But I absolutely need to customize them. Another problem is that the variables do not appear when I edit the template of an email.
Thank you in advance for your help.
I've used this package a while ago, you've made some fixes but I am still running into one:
Argument 1 passed to App\Mail\ContactEmail::__construct() must be of the type array, string given
use Queueable, SerializesModels;
public $data;
/**
* Create a new message instance.
*
* @param array $data
*/
public function __construct(array $data = [])
{
$this->data = $data;
}
This is awesome package. Very simple and usful.
I am implementing it in one of my prejct but then I want to show the list of document links which will be dynamic.
I can see, I can use custom variables like { first_name } which is pretty simple text but what if I want to show dynamic image(s) or the list of some dynamic data like list of document links or any address or data of mutilple users? How can we achieve this?
I have created a mailable and then all of sudden on the /mailables route I get this error
Cannot use object of type ReeceM\\Mocker\\Mocked as array
It happens because you are not sending CSRF Token
I fixed it adding it
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
To the AJAX call, so it looks like:
previewRender: function (plainText, preview) {
// return preview.innerHTML = 'sacas';
$.ajax({
method: "POST",
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
url: "{{ route('previewTemplateMarkdownView') }}",
data: {markdown: plainText, name: '{{ $template['slug'] }}'}
}).done(function (HtmledTemplate) {
preview.innerHTML = HtmledTemplate;
});
return '';
},
I have a app laravel modulated. Each module contains your classes /Mails /Notifications etc. But i can't keep my workflow with mail eclipse because he know only one folder app_path('Mail/'). Is possible implements this for many folders ?
I have seen that similar issues have been already submitted & resolved, but I was not able to find a clear explanation what I have to do in order to fix this issue. I have MailEclipse version 1.3 installed
There is a ProductCreated
mailable & product-created.blade.php
markdown template. In that template file I have the following line:
New product "{{ $product->title }}" was created by user: {{ $product->user->fullname }}
Mailable class:
class ProductCreated extends Mailable
{
use Queueable, SerializesModels;
/**
* @var User
*/
public $user;
/**
* @var Product
*/
public $product;
/**
* Create a new message instance.
*
* @param User $user
* @param Product $product
*/
public function __construct(User $user, Product $product)
{
$this->user = $user;
$this->product = $product;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('emails.product-created');
}
}
Please assist. Thanks.
I use a "modules" approach to all my laravel projects which means that all of my project-related code lives inside a "modules" folder in the base path
So I changed the mailables_dir to
'mailables_dir' => base_path('modules/myproject/src/Mail/'),
Unfortunately this doesn't work correctly. The only file that was sucesfully created in that folder is the templates.json
When I used the UI to add a new Mailable item, since it just runs the built-in artisan make:mail
command it created the mailable php file inside app/Mail
But then your package does correctly look in the configured mailables_dir for mailables, so it ends up finding none. I had to move the generated file manually and changed the namespace accordingly
I've run into this issue before and found this package, which needed some modifications so I created a fork here that allows the use of all built-in "make" commands that can create files anywhere with the correct namespace https://github.com/vesper8/artisan-make-file-location/commits/master
Anyway this may be more than you're willing to add.. but I wanted to point out that without this the mailables_dir configuration does not really work.. at least, it doesn't work with creating the mailables in that configured folder. But it does work if you move the mailables to that folder manually
The other thing I wanted to request is the ability to configure where the templates are stored. I also want my templates to live under my modules folder.. specifically they would live here:
base_path('modules/myproject/resources/views/vendor/maileclispe/templates/'),
Of course for now I can just manually move them there, but I figured if you allow us to configure where the Mailables are loaded from you could also allow this
Big thanks for this package! I look forward to future improvements
Is there a way to edit the subject?
I have deployed a development version on Heroku to share with my Team.
I am unable to access any of the Maileclipse routes. Get, 403 Forbidden.
I have uncommented environment settings
//'allowed_environments' => ['local', 'staging', 'testing', 'development'],
And I have Route Middleware set to
'middlewares' => [
'web',
'auth',
],
Otherwise this is a clean installation of Laravel 5.8 with standarad "make: Auth"
No other packages are installed.
It is working fine on localhost.
I can login/logout on the deployed version and I can access the default "home" route that I also added to the auth middleware.
Any ideas?
i got error Trying to get property 'token' of non-object"
when i pass object though construct is there an alternative solution to solve this
`protected $token, $user_name;
public function __construct($user_activation)
{
$this->token = $user_activation->token;
$this->user_name = $user_activation->user->name;
}`
Case: I separate my apps on modules, for example via https://github.com/nWidart/laravel-modules
Each module has a separate directory for emails like base_path('Modules/*/Mail/')
.
and app_path('Mail/')
of cource.
It will be very cool to be able to work with many directories at the same time.
When i add auth middleware after that if i am logged in and try to access the maileclipse then it redirects me to the dashboard instead of maileclpise url. On the other side if i am not logged in then it will redirect me to the login page which is expected behaviour
Hi there! First of all great application you have built. Lots of potential.
name: Feature request
About: How to add subject
Currently I don't see a subject field that is available in a mailable objet
Would like an editable field to insert the subject of the email
having them as hard coded variables in the mailable container
was wondering if there is a branch with a version I can explore?
I deployed a test installation on Heroku.
I moved all dev dependencies to required just to make sure they were all installed on the live site.
I am not able to load the maileclipse route,
I have reinstalled all the packages, dumped-autoload, cleared app cache, even rebuild the server.
This is a clean Laravel 5.8 installation. No other packages installed.
I can login/logout and access the home route which I also use the auth middleware.
(1/1) ErrorClass 'Faker\Factory' not found
--
in DatabaseServiceProvider.php line 78
at DatabaseServiceProvider->Illuminate\Database\{closure}(object(Application), array())in Container.php line 787
at Container->build(object(Closure))in Container.php line 667
at Container->resolve('Faker\\Generator', array())in Container.php line 615
at Container->make('Faker\\Generator', array())in Application.php line 767
at Application->make('Faker\\Generator')in DatabaseServiceProvider.php line 83
at DatabaseServiceProvider->Illuminate\Database\{closure}(object(Application), array())in Container.php line 787
at Container->build(object(Closure))in Container.php line 667
at Container->resolve('Illuminate\\Database\\Eloquent\\Factory', array())in Container.php line 615
at Container->make('Illuminate\\Database\\Eloquent\\Factory', array())in Application.php line 767
at Application->make('Illuminate\\Database\\Eloquent\\Factory', array())in helpers.php line 121
at app('Illuminate\\Database\\Eloquent\\Factory')in mailEclipse.php line 569
at mailEclipse::handleMailableViewDataArgs('App\\Mail\\WelcomeBookerEN')in mailEclipse.php line 724
at mailEclipse::buildMailable('App\\Mail\\WelcomeBookerEN')in mailEclipse.php line 497
at mailEclipse::mailablesList()in mailEclipse.php line 26
at mailEclipse::getMailables()in MailablesController.php line 27
at MailablesController->index()
at call_user_func_array(array(object(MailablesController), 'index'), array())in Controller.php line 54
--
at Controller->callAction('index', array())in ControllerDispatcher.php line 45
at ControllerDispatcher->dispatch(object(Route), object(MailablesController), 'index')in Route.php line 219
//...followed by routing ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.