knadh / listmonk

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
https://listmonk.app
GNU Affero General Public License v3.0
14.46k stars 1.32k forks source link

Add support for functions to transactional email templates #1596

Closed peterjcarroll closed 3 weeks ago

peterjcarroll commented 9 months ago

I would like to be able to use the functions listed in the documentation at https://listmonk.app/docs/templating/#functions in my templates for transactional emails.

I am especially interested in using TrackLink, TrackView, and UnsubscribeURL.

I saw in issue #1409, you felt that unsubscribe urls don't apply to transactional emails, but it my case they do. I'm sending transactional emails to my mailing list users via the API because Listmonk doesn't support sending an email triggered by a new subscription.

I also know that normally the unsubscribe link has the campaign uuid in the url, but in the opt-in emails, the unsubscribe link just uses a uuid of all zeros instead of a campaign uuid. The unsubscribe url for transactional emails could be done the same way.

Thanks for your hard work on Listmonk!

javierarce commented 9 months ago

I was about to request the same thing when I discovered that the URL {{ RootURL }}/subscription/{{ .Subscriber.UUID }}/{{ .Subscriber.UUID }} works and I used it to unsubscribe from a system email.

P.S.: I'm new to listmonk, and I haven't tested this in a transactional email.

LordPraslea commented 4 months ago

This is usefull in a way things like TrackLink would be usefull for transactional emails

github-actions[bot] commented 1 month ago

This issue has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.