Giter VIP home page Giter VIP logo

gochimp's Introduction

Matt's GitHub stats

gochimp's People

Contributors

antoineheb avatar bjyoungblood avatar bochenski avatar bom-d-van avatar cgansen avatar dolmen avatar eduohe avatar elimisteve avatar enahs avatar georgevanburgh avatar hrolikovsergey avatar hwsoderlund avatar ianrose14 avatar jacksontbryan avatar jefferai avatar jkassemi avatar johngibb avatar kimgressens avatar kyleconroy avatar mattbaird avatar mcroydon avatar mrtravisb avatar ppone avatar pzurek avatar roosmaa avatar sdrew avatar sebastiaanklippert avatar shazow avatar vpashka avatar zacg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gochimp's Issues

Host is being encoded

Running go 1.5 here. Receiving this error when running client.MessageSend.

panic: parse https://mandrillapp.com%2Fapi%2F/1.0/messages/send.json: percent-encoded characters in host

TrackOpens and TrackClicks overriding mandril default options

If you don't set TrackOpens or TrackClicks they are set to false and overriding mandrills default sending options.

Ie this happens even if you don't set them to false. Perhaps a NewMessage() func could fix this or adding functions to set them since they really have 3 values true, false, and none(default to mandrill settings).

MessageSend() does not honor Mandrill template defaults

When I create a new message where I leave out the fields Subject, FromEmail, FromName, the values which I have set in Mandrill (https://mandrillapp.com/templates) are ignored.

Go snippet:
message := gochimp.Message{ Html: renderedTemplate, To: recipients, TrackClicks: true, TrackOpens: true, }

Mandrill template configuration:
screen shot 2018-08-07 at 16 18 40

My assumption is that gochimp is still sending an empty string via the Mandrill API. Omitting the field when it is not set might honor the predefined values in Mandrill.

Message.ViewContentLink can't be set

When sending a transactional message with the mandrill API, there is a flag, view_content_link, that can be set to tell mandrill to discard the sent message's content so that people who can access the logs can't click on "View content". This flag is true by default and must be hard-set to false.

However... the Message struct declares this field with omitempty, so you it won't be sent when set to false.

type Message struct {
	// ...
	ViewContentLink  bool  `json:"view_content_link,omitempty"`
	// ...
}

Removing omitempty would mean messages would always send view_content_link: false, it's a go quirk, I'm not sure if there is an "elegant" way to fix this. Maybe with a pointer to bool?

how to use the chimp api, response seems empty

Hi!
Thanks for the API wrapper looks good!
I checked out a API from mailchimp and tried the templatelist function. What am i missing ? Checked that is used the correct endpoint, but there seems to be no response unmarshaled into the listresponse.

chimp := gochimp.NewChimp("mykey", true)
    mylist := gochimp.TemplatesList{}
mylist.ApiKey = "mykey"
mylist.Filters.IncludeDragAndDrop = true
myresp, err := chimp.TemplatesList(mylist)

if err != nil {
    fmt.Print(err)
}

for _, val := range myresp.User {
    fmt.Print(val.Id)
}

 for _, val := range myresp.Gallery {
    fmt.Print(val.Id)
}

Incompatible with Handlebars templates

I was having some trouble getting this library to work with templates that were using handlebars for Mandrill.

After looking into the issue, it seems like the root of the issue is that Handlebars expects the variables to be structured slightly differently from the way gochimp is structuring them.

As mentioned in the blog post, a handlebars template expects pure key/value pairs to be in global_merge_vars, and expects {email: {key: value}} pairs for the merge_vars paramater.

Whereas the TemplateRender in gochimp seems to hand off two paramaters, content and merge_vars, both of which are simple key/value pairs.

(This is my best estimation as to why I was getting blank variables in my templates, and will be investigating further in the next few days, but the above seems like it could be the root of the issue).

Error rendering template

I get this error using the example in README.md:

$ go run gochimp.go 
Error rendering template

The mail sends regardless, just with an empty message body. golang is 1.4.2 on Arch Linux.

Linking a context object with the request

I'm using mandrill for server-side transactional emails and I'm wondering if there is a way to forward the context.Context object from my requests to the gochimp client or request. I couldn't find a way to do it in the API, is there one I missed? (Couldn't find any issues on this either)

If not, would it be possible to add a way?

Cheers!

No support for multiple BCC's?

Trying to BCC multiple people, but the Message's BCCAddress field doesn't accept comma separated email addressed and using

message.AddRecipients(Recipient{Email: "[email protected]", Name: "Test", Type: "bcc"})

Just sends the message as "to" instead of a bcc

EDIT: if I set PreserveRecipients: true it does seem to send BCC, but without the 'to' recipients email address. Seems like it might be an issue with Mandrill itself

message.BCCAddress is a parameter but doesn't send an email to that address

This is probably a vestigial parameter from older days however I got confused by it for a while. I was looking for message.CC or similar and couldn't find it as a parameter so went with message.BCCAddress but that didn't do anything either. Then realized I need to add an extra message.Recipient and set the Recipient.Type to bcc or cc as necessary.

github.com/picatic/gochimp is not available anymore

Hello!

I'm trying to vendor your library but my vendor tool (gvt) failed due to missing dependencies:

bin/gvt fetch github.com/mattbaird/gochimp
2017/09/06 19:44:11 Fetching: github.com/mattbaird/gochimp
2017/09/06 19:44:13 · Fetching recursive dependency: github.com/picatic/gochimp
Username for 'https://github.com': 
Password for 'https://github.com': 
remote: Repository not found.
fatal: Authentication failed for 'https://github.com/picatic/gochimp/'
2017/09/06 19:44:28 skipping insecure protocol: git://github.com/picatic/gochimp
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
2017/09/06 19:44:29 skipping insecure protocol: http://github.com/picatic/gochimp
2017/09/06 19:44:29 command "fetch" failed: error fetching github.com/picatic/gochimp: vcs probe failed, tried: https://github.com/picatic/gochimp,ssh://github.com/picatic/gochimp

And according to GitHub this library was removed or renamed (https://https://github.com/picatic/gochimp) :(

Could you remove/correct dependency to this code?

Thank you!

Incorrect date format for requests.

When trying to use the MessageSearch functionality, it appears the date formatting isn't right when we marshal a DateFrom field.

error="-2: Validation error: {\"date_from\":\"Please enter the date in the form MM\\/DD\\/YYYY\"}"

Looks like we need to add a custom marshaller for APITime

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.