Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

heeus/extensions-tinygo

Repository files navigation

extensions-tinygo

Usage

package main

import (
	ext "github.com/heeus/extensions-tinygo"
)

//export exampleExtension
func exampleExtension() {
	event := ext.GetValue(ext.KeyBuilder(ext.StorageEvent, ext.NullEntity))

	if event.AsString("qname") == "air.UpdateSubscription" {
		json := event.AsValue("arg")
		subscr := json.AsValue("subscription")
		customer := json.AsValue("customer")
		mail := ext.NewValue(ext.KeyBuilder(ext.StorageSendmail, ext.NullEntity))
		mail.PutString("from", "[email protected]")
		mail.PutString("to", customer.AsString("email"))
		mail.PutString("body", "Your subscription has been updated. New status: "+subscr.AsString("status"))
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages