You can add an unsubscribe link by adding an
::unsubscribeUrl:: placeholder to the HTML of your campaign.
When a subscriber visits the actual unsubscribe URL, a simple message will be displayed to confirming that they have successfully unsubscribed.
To customize this confirmation message, publish the views.
php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-views"
Now we modify the following views in the
You can also unsubscribe someone manually like this.
Alternatively, you can call unsubscribe on a subscriber
Unsubscribing using an email client
Emails sent have the
List-Unsubscribe header included. This allows for users to unsubscribe from their email client as per RFC2369.
Permanently deleting a subscriber
Behind the scenes, the subscriber won't be deleted. Instead, the status of the subscription will be updated to
If you want to delete the subscription/subscriber entirely, you can call
delete on it.
The code above will also delete all related subscriptions.