diff --git a/cmd/towncon/main.go b/cmd/towncon/main.go index e7a3d78..cbba510 100644 --- a/cmd/towncon/main.go +++ b/cmd/towncon/main.go @@ -290,6 +290,56 @@ func submit(o opts) error { return nil } +type euroData struct { + Username string + Interested bool +} + +func euro(o opts) error { + euroContent, err := md.ReadFile("md/euro.md") + if err != nil { + return err + } + out, err := glamour.Render(string(euroContent), "auto") + if err != nil { + return err + } + fmt.Println(out) + + var interested bool + + form := huh.NewForm( + huh.NewGroup( + huh.NewConfirm().Title("So...would you be interested?").Value(&interested), + )).WithTheme(huh.ThemeBase()) + + if err := form.Run(); err != nil { + return err + } + + ed := euroData{ + Username: o.Username, + Interested: interested, + } + + if err = sendEuroEmail(vd); err != nil { + return err + } + + fmt.Println("THANK YOU~!!") + + return nil +} + +func sendEuroEmail(ed euroData) error { + bs, err := yaml.Marshal(vd) + if err != nil { + return err + } + + return email.SendLocalEmail("vilmibm", "TOWNCON25 EURO INTEREST", string(bs)) +} + type voteData struct { Username string Days []string @@ -446,6 +496,7 @@ func _main() error { huh.NewSelect[string]().Title("whadduyu wanna doo?"). Options( huh.NewOption("VOTE ON DAY", "vote"), + huh.NewOption("EUROPE: REGISTER INTEREST", "euro"), huh.NewOption("Get an info dump", "info"), //huh.NewOption("SEE SCHEDULE", "schedule"), //huh.NewOption("RSVP", "rsvp"), @@ -472,6 +523,8 @@ func _main() error { return jam(o) case "vote": return vote(o) + case "euro": + return euro(o) case "quit": default: return fmt.Errorf("wtf '%s'", mode) diff --git a/cmd/towncon/md/euro.md b/cmd/towncon/md/euro.md new file mode 100644 index 0000000..6c878ef --- /dev/null +++ b/cmd/towncon/md/euro.md @@ -0,0 +1,5 @@ +On the 11th of October there will be an informal tilde town meetup. The 11th is the actual birthday of the town so it'll be a special little bday party. + +It will be in Italy in either Florence or Rome; timing/venue TBD but the day is for sure. + +Getting a rough headcount now will help us plan better!