# HG changeset patch # User Yader Velasquez # Date 1668819770 21600 # Fri Nov 18 19:02:50 2022 -0600 # Node ID 1e8c7436252d5eb45da5eb7bdbf53f425803f823 # Parent a8f2fca10083288596efbd72f5ab2ad87497aded Add README diff --git a/README.md b/README.md new file mode 100644 --- /dev/null +++ b/README.md @@ -0,0 +1,157 @@ +sendygo [![nlshield](https://img.shields.io/badge/100%25-Netlandish-blue.svg?style=square-flat)](http://www.netlandish.com) +---- + +A simple Go client to interface with the Sendy API () + +**Version:** 0.1.0 + +**Sendy API Version:** 6.0.3 + +**Author** Netlandish () + +# Dependencies + +- It was written for Go 1.18+ +- No external dependencies are required + +# Installation + + go get hg.code.netlandish.com/~netlandish/sendygo + +# Use + +All the variables and response values are described in the [Sendy API +docs](https://sendy.co/api) + +Usage is simple: + + import "hg.code.netlandish.com/~netlandish/sendygo" + + baseURL := "https://your-sendy-install.com/sendy/" + apiKey := "YOUR_API_KEY" + debug := true + + client := sendy.NewClient(baseURL, apiKey, debug) + +**Subscribe** : + + err := client.Subscribe(sendy.SusbcribeParams{ + List: "list id here", + Email: "email@address.com", + Name: "Name", + Country: "NI", + Referrer: "https://webpage.com", + GDPR: true, + }) + +*Fields* + +- `Email`: user's email +- `List`: the list id you want to subscribe a user to +- `Name`: user's name (optional) +- `Country`: user's 2 letter country code (optional) +- `IPAddress`: user's IP address (optional) +- `Referrer`: the URL where the user signed up from (optional) +- `GDPR`: if you're signing up EU users in a GDPR compliant manner, set this to "true" (optional) +- `Silent`: set to true if your list is 'Double opt-in' but you want to bypass that and signup the user to the list as 'Single Opt-in instead' (optional) +- `HP`: include this 'honeypot' field to prevent spambots from signing up via this API call. (optional) + +**Unsubscribe** : + + err := client.Unsubscribe(sendy.UnsusbcribeParams{ + List: "list id here", + Email: "email@address.com", + }) + +**Delete** : + + err := client.DeleteSubscriber(sendy.ActionParams{ + List: "list id here", + Email: "email@address.com", + }) + +**Subscription Status** : + + status, err = client.SubscriptionStatus(&sendy.ActionParams{ + List: "list id here", + Email: "email@address.com", + }) + +**Subscriber Count** : + + count, err := client.SubscriberCount(sendy.ActionParams{ + List: "list id here", + }) + + +**Create Campaign** : + + action, err := client.CreateCampaign(sendy.CreateCampaignParams{ + FromName: "Your Name", + FromEmail: "Your Sender Email", + ReplyTo: "Your Reply-to Email", + Title: "Email Title", + Subject: "Email Subject", + PlainText: "Plain text for the email", + HTMLText: "

Html format for the email

", + ListIDS: "listIDOne,listIDTwo,listIDThree", + BrandID: "Your Brand ID", + QueryString: "Your Query String", + SendCampaign: 1, + SegmentIDS: "SegmentOne, SegmentTwo", + ExcludeListIDS: "listIDOne,listIDTwo,listIDThree", + ExcludeSegmentsIDS: "SegmentOne, SegmentTwo", + TrackOpens: 1, + TrackClicks: 1, + ScheduleDateTime: "June 15, 2023 6:05pm", + ScheduleTimeZone: "America/New_York", + }) + +# Contributing + +We accept patches submitted via `hg email` which is the `patchbomb` extension +included with Mercurial. + +Please see our [contributing document][cdoc] for more information. + +The mailing list where you submit your patches is +`~netlandish/public-inbox@lists.code.netlandish.com`. You can also view the +archives on the web here: + +https://lists.code.netlandish.com/~netlandish/public-inbox + +To quickly setup your clone of `sendygo` to submit to the mailing +list just edit your `.hg/hgrc` file and add the following: + + [email] + to = ~netlandish/public-inbox@lists.code.netlandish.com + + [patchbomb] + flagtemplate = {separate(' ', 'sendygo', flags)} + + [diff] + git = 1 + +We have more information on the topic here: + +- [Contributing][cdoc] +- [Using email with Mercurial][hgemail] +- [Mailing list etiquette][etiquette] + +[etiquette]: https://man.code.netlandish.com/lists/etiquette.md +[hgemail]: https://man.code.netlandish.com/hg/email.md +[cdoc]: https://man.code.netlandish.com/contributing.md + +# Copyright & Warranty + +All documentation, libraries, and sample code are Copyright 2022 +Netlandish Inc. <>. The +library and sample code are made available to you under the terms of the +BSD license which is contained in the included file, LICENSE. + +# Commercial Support + +This software, and lots of other software like it, has been built in +support of many of Netlandish's own projects, and the projects of our +clients. We would love to help you on your next project so get in touch +by dropping us a note at .