Laravel 5.4 mail markdown 2 кнопки встроенный - PullRequest
0 голосов
/ 27 ноября 2018

Я хотел бы знать, как разместить кнопку рядом друг с другом.

enter image description here

Теперь она находится на отдельной строке.

@component('mail::message')
    Dear {{$vendor_name}}

    Product {{$product_id}} : {{$product_name}} price id : {{$price_id}} will expire on {{$date_expire}}.
    Please renew price.


@component('mail::button', ['url' => 'http://phuketjettour.com/', 'color' => 'green'])
    Phuket Jet Tour
@endcomponent
@component('mail::button', ['url' => 'http://phuketjettour.com/s/vendors'])
    Vendor submission
@endcomponent
    Thanks,<br>
    Phuket Jet Tour

@endcomponent

Ответы [ 2 ]

0 голосов
/ 27 ноября 2018

Это просто работа.Я проверил электронное письмо от проекта laravel.

попробуйте это вместо вашего компонента для кнопки:

<a href = "http://phuketjettour.com/" class="button button-green"> Phuket Jet Tour</a>
<a href = "http://phuketjettour.com/" class="button button-blue">SAMPLE !</a>

она встроена в вашу кнопку.тогда просто настройте другой элемент.Если вы хотите поместить кнопку на уценку, вам нужно:

На вашей уценке:

$button1= "   <a href = "http://phuketjettour.com/" class="button button-green"> Phuket Jet Tour</a>";
$button2 = "<a href = "http://phuketjettour.com/" class="button button-blue">SAMPLE !</a>";

  $emailMarkdown = $this->markdown('your_email_template')
                ->subject('your_subject)
                //you will define here the variables you need to pass in the template
                ->with([    
                   'emailBody' => $emailBody,
                   'button_first' => $button1,
                   'button_second' => $button2,
                ]);

     return $emailMarkdown;

, а затем на шаблоне электронной почты:

@component('mail::message')
        Dear {{$vendor_name}}

        Product {{$product_id}} : {{$product_name}} price id : {{$price_id}} will expire on {{$date_expire}}.
        Please renew price.

    {!!$button_first!!} {!!$button_second!!}
@endcomponent
0 голосов
/ 27 ноября 2018

вы можете поместить его в один <div> Например:

<div class = "row>

ваши кнопки здесь

</div>

Если это не поможет, поделитесь кодом


Попробуйте это:

<span style="display: inline;">

@component('mail::button', ['url' => 'http://phuketjettour.com/', 'color' => 'green'])
    Phuket Jet Tour
@endcomponent
@component('mail::button', ['url' => 'http://phuketjettour.com/s/vendors'])
    Vendor submission
@endcomponent

</span>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...