Skip to content

Conversation

@prachi-mantri
Copy link

@prachi-mantri prachi-mantri commented Mar 26, 2018

Hello, I was working with a team which needed to use the Marketo API
like an email marketing tool. The idea was to have a campaign which
would send an email whenever it was run. The content of the email being
sent could be changed whenever needed. As a result, I used the marketo
API for E-mails and campaigns and added some functionality to the mrkt
gem. These are the changes done:

  1. Get an email's information using it's ID
  2. Update an email's subject
  3. Update the content of an email
  4. Add code to schedule a campaign (doesn't work as expected, though)

The trouble is that currently scheduling a campaign using this code does
not run the campaign when needed, it' always 5 minutes after the request
is sent to Marketo (even though we're sending it in the format that Marketo
needs it in.) Or perhaps I've made a mistake. Please feel free to reject the
changes and let me know what I need to add/remove/change. I will really
appreciate your feedback on the pull request. Thanks!

This commit adds a sample code to access Marketo emails by ID and name.
It also has a method to be able to access an email's content.
IMPORTANT: while sending data to update email, make sure the content
type is multipart/form-data
- add code to update emai subject
- add a new error class for code 702 (no data found)
- add spec for campaign schedule and email
@prachi-mantri
Copy link
Author

prachi-mantri commented Mar 26, 2018

Apologies about the RSpec suite failing in the CI build. Could you suggest anything? Sending a hash in the Marketo API URL works for me (I had run the RSpec suite before pushing the changes)

@raszi
Copy link
Owner

raszi commented Mar 27, 2018

Thanks for the changes @prachi-mantri. The issue is that you need to URL encode the subject parameter if you want to send over a JSON parameter like that.

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.

2 participants