Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a template helper for converting slice of bytes to UUID representation #44

Closed
cwjohnston opened this issue Oct 29, 2020 · 0 comments · Fixed by #45
Closed

Add a template helper for converting slice of bytes to UUID representation #44

cwjohnston opened this issue Oct 29, 2020 · 0 comments · Fixed by #45

Comments

@cwjohnston
Copy link

I want to include event IDs in notifications, e.g. providing the uuid form of the ID in an email for debugging purposes.

Using the email handler template capability, I can create emails using the template Event ID: {{ .ID }} but this is a slice of bytes and is rendered in the resulting email as Event ID: [209 148 75 68 153 63 79 30 190 227 200 57 207 112 180 28]

I believe the UUID representation can be created from a slice of bytes using https://godoc.org/github.com/google/uuid#FromBytes .

The SDK implements some helpers for rendering templates, e.g. UnixTime template function. I propose we add a UUIDFromBytes template function which would make the above linked function available to handlers using the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant