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

Mailables Generate in the default folder even though mailables_dir is set #88

Closed
UdyW opened this issue May 20, 2020 · 3 comments
Closed
Labels
bug Something isn't working v5 version 5, supports both API and self hosted

Comments

@UdyW
Copy link
Contributor

UdyW commented May 20, 2020

In the config the the mailables_dir is set

'mailables_dir' => app_path('Mail/CustomTemplates')

But when mailables are generated they would still be generated in the default Mail folder.

@Qoraiche Qoraiche added the bug Something isn't working label May 28, 2020
@Idimma
Copy link

Idimma commented Jun 9, 2020

This is due to the namespace App\Mail coming from $exitCode = Artisan::call('make:mail', $params->all());

@ReeceM
Copy link
Collaborator

ReeceM commented Sep 22, 2020

For anyone who will work on this in the coming Hacktoberfest season. Please mark that you would like to work on this.

@ReeceM
Copy link
Collaborator

ReeceM commented Sep 22, 2020

Also the mailables_dir config value seems to handle where the templates.json file is stored, it is never referenced in the actual function in creating a new mailable, although it is used when deleting the mailable, so that is a plus as adding it to the create function would not break that part.

If you do use the naming from the mailables_dir, you will actually get the entire real path of the app, it will then create a really weird namespace under the mail area.

The change would probably be to make the config value reflect a namespace without the app_path call, and do that in the function calls when needing the actual path to the file.

Then use the config value as the namespace and also the file path to resolve when creating the mailables.

@Qoraiche Qoraiche added the v5 version 5, supports both API and self hosted label Aug 2, 2023
@Qoraiche Qoraiche closed this as completed Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working v5 version 5, supports both API and self hosted
Projects
None yet
Development

No branches or pull requests

4 participants