Laravel markdown mail print raw html - laravel

I have this markdown template but it print row html in user mailbox
Code
#component('mail::message')
# Dear {{$user['name']}},
#component('mail::panel')
New Bank Account has been added to your profile.
| Bank | Acc. No. | Acc. Holder |
| ----------------- | ----------------------- | --------------------------- |
| {{$bank['name']}} | {{$bank['account_no']}} | {{$bank['account_holder']}} |
#endcomponent
Thanks,<br />
{{ config('app.name') }}
#endcomponent
Result
any idea?

try using #component('mail::table')
#component('mail::message')
# Dear {{$user['name']}},
#component('mail::panel')
New Bank Account has been added to your profile.
#component('mail::table')
| Bank | Acc. No. | Acc. Holder |
| ----------------- | ----------------------- | --------------------------- |
| {{$bank['name']}} | {{$bank['account_no']}} | {{$bank['account_holder']}} |
#endcomponent
#endcomponent
Thanks,<br />
{{ config('app.name') }}
#endcomponent

Related

Laravel mail::table not rendering a table

I had a problem on my mail::table in Laravel Markdown Mailables. The table is not rendering. I have also no indents on it.
emails/inquiry.blade.php
#component('mail::message')
#New Inquiry
We have received a new inquiry
#component('mail::table')
| Laravel | Table | Example |
| ------------- |:-------------:| --------:|
| Col 2 is | Centered | $10 |
| Col 3 is | Right-Aligned | $20 |
#endcomponent
Thanks
#endcomponent
Mailtrap output

Route returning Error 404 but the route exists

I have a blade template where I call a route to the show method:
<div class="user"><div><img src="{{asset('images/user.svg')}}" alt=""></div></div>
That route is controlled by a resource controller and the routes are set like this:
Route::resource('profile', 'App\Http\Controllers\ProfileController')->middleware('auth');
All the routes of that controller are defined as you can see from the output of my php artisan route:list:
| | GET|HEAD | profile | profile.index | App\Http\Controllers\ProfileController#index | web |
| | | | | | auth |
| | POST | profile | profile.store | App\Http\Controllers\ProfileController#store | web |
| | | | | | auth |
| | GET|HEAD | profile/create | profile.create | App\Http\Controllers\ProfileController#create | web |
| | | | | | auth |
| | GET|HEAD | profile/{profile} | profile.show | App\Http\Controllers\ProfileController#show | web |
| | | | | | auth |
| | DELETE | profile/{profile} | profile.destroy | App\Http\Controllers\ProfileController#destroy | web |
| | | | | | auth |
| | PUT|PATCH | profile/{profile} | profile.update | App\Http\Controllers\ProfileController#update | web |
| | | | | | auth |
| | GET|HEAD | profile/{profile}/edit | profile.edit | App\Http\Controllers\ProfileController#edit | web |
| | | | | | auth |
So far the controller only has a dd function since I haven't started writing it yet and the show method is the only one with anything written yet:
public function show($id)
{ dd($id);}
But for some reason, whenever I try acessing that route, it returns a 404 Not Found error. I tried accessing the index method and it works, but the show method always returns the 404 Not Found error. I also tried php artisan route:clear but it didn't solve the problem. What could I be doing wrong here?
Try out it , list all of router
php artisan route:list
Or you can as such that
Route::resource('profile', 'ProfileController', [
'names' => [
'index' => 'show.show'
'store' => 'profile.new',
]
]);
And if you try this ?
<div class="user"><div><img src="{{asset('images/user.svg')}}" alt=""></div></div>

Route::has note detecting route resource

I am trying to create links in the top nav menu using the code to check if the route name has a text pattern in it.
All is working except for one route which is also defined as a resource.
Below is my code in the web.php file
Route::get('/bookings', 'BookingController#index')->name('bookings');
Route::resource('/bookings', 'BookingController');
In the app.blade.php file I have the code:
#if (Route::has('bookings'))
<li class="nav-item">
<a class="nav-link" href="{{ route('bookings') }}">{{ __('Bookings') }}</a>
</li>
#endif
I checked the routes in php artisan and its listed as existing.
| api,auth:api |
| | POST | bookings | bookings.store | App\Http\Controllers\BookingController#store | web |
| | GET|HEAD | bookings | bookings.index | App\Http\Controllers\BookingController#index | web |
| | GET|HEAD | bookings/create | bookings.create | App\Http\Controllers\BookingController#create | web |
| | PUT|PATCH | bookings/{booking} | bookings.update | App\Http\Controllers\BookingController#update | web |
| | GET|HEAD | bookings/{booking} | bookings.show | App\Http\Controllers\BookingController#show | web |
| | DELETE | bookings/{booking} | bookings.destroy | App\Http\Controllers\BookingController#destroy | web |
| | GET|HEAD | bookings/{booking}/edit | bookings.edit | App\Http\Controllers\BookingController#edit
Route::has('bookings') checks the route list for a route named bookings. While you've got a URL of bookings, its name in the route list is bookings.index - you don't have any route named bookings.
(Per your php artisan route:list output, your route from the Route::resource call is wiping out the earlier Route::get call. Remove that redundant/ignored Route::get definition.)
Route::has('bookings.index') should do the trick (and changing route('bookings') to route('bookings.index').

Laravel blade template not rendering table properly

I'm quite new to Laravel, but have recently taken over a project from someone and trying to get the mail blade templates to render but I am having problems.
The code used for the enquiry email template is as follows:
#component('mail::message')
#New customer enquiry
We have received a new customer enquiry.
#component('mail::table')
| **Name** | **Email** | **Telephone** |
| ---------------------------------------------- |:---------------------:| -----------------------:|
| {{$enquiry->firstname}} {{$enquiry->lastname}} | <{{$enquiry->email}}> | {{$enquiry->telephone}} |
#endcomponent
Thanks,<br>
{{ config('app.name') }}
#endcomponent
But the table always renders as raw HTML, here is a screenshot of how the email looks in MailCatcher:
I've checked a couple of other posts that concern this kind of issue but usually it's due to the attempt to render more than one table in a mail template, but this is just a single table. Is there a component I have missed or is it just MailCatcher not rendering correctly?
When using Markdown to render emails, avoid using indents excessively. Your code should look like this
#component('mail::message')
#New customer enquiry
We have received a new customer enquiry.
#component('mail::table')
| **Name** | **Email** | **Telephone** |
| ---------------------------------------------- |:---------------------:| -----------------------:|
| {{$enquiry->firstname}} {{$enquiry->lastname}} | <{{$enquiry->email}}> | {{$enquiry->telephone}} |
#endcomponent
Thanks,<br>
{{ config('app.name') }}
#endcomponent
You didn't show how the html which is not being rendered is being loaded.
But it's possible you need to use {!! !!} instead of {{ }} for the variables that contain html.

Where is Magento registration form data stored?

Where is Magento registration form data stored? In which database table(s)?
to find out query used to get the customer data do this, and this is probably EAV structure where all data is kept:
<?php echo Mage::getModel('customer/customer')->getCollection()->getSelect();?>
or this
<?php echo Mage::getModel('customer/customer')->load('customerid')->getSelect();?>
and to find out what fields are available on default collection or load:
<?php print_r(Mage::getModel('customer/customer')->getCollection()->getFirstItem()->getData());?>
or this
<?php print_r(Mage::getModel('customer/customer')->load('customerid')->getData());?>
Anton's answer is correct for accessing data through the Magento framework. To answer your question literally, the following tables store the basic customer data:
+----------------------------------+
| Tables_in_entp (customer%) |
+----------------------------------+
| customer_address_entity |
| customer_address_entity_datetime |
| customer_address_entity_decimal |
| customer_address_entity_int |
| customer_address_entity_text |
| customer_address_entity_varchar |
| customer_entity |
| customer_entity_datetime |
| customer_entity_decimal |
| customer_entity_int |
| customer_entity_text |
| customer_entity_varchar |
+----------------------------------+

Resources