MattB's avatar
Level 2

Sending custom emails

How would one go about sending a custom email? I have an ecommerce shop but would like to know how to customise the email sent to customers showing all they have bought. The below email works but I was wondering if there was a better way, as when it's sent the bootstrap link won't work until the customer allows it when they open the mail, and I can appreciate not all people are comfortable allowing all links:

@component('mail::message')
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
   Thank you for your purchase. Please find the details of your order below:
   <br>
   <br>
        <div class="row">
            <div class="col-4">Product Name</div>
            <div class="col-4">Price</div>
            <div class="col-4">Quantity</div>
        </div>
        @foreach($emailItems as $item)
        <div class="row">
            <div class="col-4">{{ $item->name}}</div>
            <div class="col-4">£{{ $item->price}}</div>
            <div class="col-4">{{ $item->quantity}}</div>
        </div>
        @endforeach
0 likes
3 replies
MattB's avatar
Level 2

Will this allow the columns from bootstrap to work?

Sinnbeck's avatar

It should yes. But remember to test it before sending to your customers :)

Please or to participate in this conversation.