Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trigger broadcast method DEV-733 #100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jeremygottfried
Copy link

@jeremygottfried jeremygottfried commented May 4, 2023

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

@skatkov
Copy link

skatkov commented Aug 2, 2023

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?

@theycallmeswift
Copy link

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

@richdawe-cio
Copy link
Contributor

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.

@theycallmeswift
Copy link

@richdawe-cio any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants