spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Signed URLs in Mailcoach campaigns #241

Closed connecteev closed 3 years ago

connecteev commented 3 years ago

Maybe this functionality exists and is buried somewhere within the code and unit tests, but I read the Mailcoach documentation and watched all the videos and couldn't find an obvious way to do this.

I'd like to incorporate signed URLs in my emails. This means: if the subscriber (who has an account in my app) clicks on a secure link in the email, it would change their user preference or setting in the app, without needing to log into the web application. Laravel offers this feature, and apparently it's also used by OhDear

What is the best-practice way to do this at the campaign-level in Mailcoach?

freekmurze commented 3 years ago

Mailcoach doesn't offer this out of the box. You might use a replacer for this. https://mailcoach.app/docs/v2/package/advanced-usage/creating-custom-placeholders

Your replacer might replace some kind of placeholder with a signed url generated by your replacer class.

connecteev commented 3 years ago

@freekmurze thanks for the tip.

How are you doing signed URLs in your newsletter, which seems to use Mailcoach? Are you using Replacers? The URLs look like this:

http://mailgun.spatie.be/c/xxxxxxxxAQAF-DtxoRVDhwaNL4j4VdlIpodK3fr8kcZm6DbgjQVsmFhjqtwAN5a3uIVlLUwbdWdtTDEIVuzjtFricqdAATVrMLCrTUxhuwnWmwR-xIGwBj-lbpBqvsZub9FOot2vEhHkRLjfR7vNB9ZmKm44mc

image

freekmurze commented 3 years ago

Those aren't signed URLs generated by Laravel. Mailgun replaces all URLs in a mail in order to track opens/clicks.

connecteev commented 3 years ago

I see..