customerio-ruby icon indicating copy to clipboard operation
customerio-ruby copied to clipboard

Add trigger broadcast method DEV-733

Open jeremygottfried opened this issue 2 years ago • 4 comments

At MLH, we extended the customerio-ruby gem to add a method for the trigger broadcast API, aka /v1/campaigns/#{broadcast_id}/triggers

This feature has been very helpful for us, and we'd love to contribute to the base gem so everyone can use it.

Here's an example demonstrating how our code works:

require "customerio"

client = Customerio::APIClient.new("your API key", region: Customerio::Regions::US)

payload = {
  emails: [
    "[email protected]",
    "[email protected]"
  ],
  data: {
    headline: "Roadrunner spotted in Albuquerque!",
    date: 1511315635,
    text: "We received reports of a roadrunner in your immediate area! Head to your dashboard to view more information!"
  },
  email_add_duplicates: false,
  email_ignore_missing: false,
  id_ignore_missing: false
}

request = Customerio::TriggerBroadcastRequest.new(
  broadcast_id: 12345,
  payload: payload
)

begin
  response = client.trigger_broadcast(request)
  puts response
rescue Customerio::InvalidResponse => e
  puts e.code, e.message
end

jeremygottfried avatar May 04 '23 22:05 jeremygottfried

It would be great to merge this PR and release. We're using this code on production as well, but we had to depend on our fork for this.

Is there anything we can help with here to get this merged?

skatkov avatar Aug 02 '23 21:08 skatkov

Maybe @richdawe-cio can help? It seems like he's been actively maintaining the gem recently

theycallmeswift avatar Dec 14 '23 03:12 theycallmeswift

Thanks for opening this PR, and providing this feature to other folks.

I'm just going to close and re-open it, so the latest version of the GitHub Actions are run on the PR.

@theycallmeswift I'm going to talk with people internally to see if we can integrate this into the client library.

richdawe-cio avatar Dec 16 '23 15:12 richdawe-cio

@richdawe-cio any update on this?

theycallmeswift avatar Jan 23 '24 15:01 theycallmeswift