You are currently reading the documentation for v6, while the latest version is v8.

Displaying webviews

On this page:

Whenever you send a campaign, a webview is also created. A webview is a hard to guess URL that people who didn’t subscribe can visit to read the content of your campaign.

You can get to the URL of the webview of a campaign:


Customizing the webview

You can customize the webview. To do this, you must publish all views:

php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-views"

After that, you can customize the webview.blade.php view in the resources/views/vendor/mailcoach/campaigndirectory.

Hiding elements from the generated webview

You can hide elements from the generated webview by wrapping them in <!-- webview:hide --> ... <!-- /webview:hide --> tags.

For example:

		<!-- webview:hide -->
		<span>Is this email not displaying correctly? <a href="{{ webviewUrl }}">View online version</a></span>
		<!-- /webview:hide -->

			... The rest of your email content
		<!-- webview:hide -->
		<a href="{{ unsubscribeUrl }}">Unsubscribe</a>
		<!-- /webview:hide -->

This will hide the unsubscribe and webview links from the generated webview HTML, making your email only display its essentials.