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"))
}
}
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
heeus/extensions-tinygo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published