mailup / mailup-ruby Goto Github PK
View Code? Open in Web Editor NEWA Ruby gem for interacting with the MailUp REST API.
License: MIT License
A Ruby gem for interacting with the MailUp REST API.
License: MIT License
Hi,
I didn't understand how to clear dynamic fields when adding (multiple times) recipients to a group. Our purpose is to update the recipient.
Ruby:
group.add_recipients [{ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'Nature'}, {Id: 4, Value: 'London'}]}]
group.add_recipients [{ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'Nature'}, {Id: 4, Value: ''}]}]
Results
> y group.recipients
---
IsPaginated: false
Items:
- Email: cesidio@example.com
Fields:
- Description: azienda
Id: 3
Value: Nature
- Description: città
Id: 4
Value: London
> group.add_recipients [{ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'Nature'}, {Id: 4, Value: ''}]}]
> y group.recipients
---
IsPaginated: false
Items:
- Email: cesidio@example.com
Fields:
- Description: azienda
Id: 3
Value: Nature
- Description: città
Id: 4
Value: London
I also tried { Id: 4, Value: nil }
, { Id: 4 }
(this one doesn't work at all), { Id: 4, Value: ' ' }
. An example would be great
And everything is gone from gh too!
That's what I call responsible version management!
Thanks!
Hi,
the example here:
https://github.com/mailup/mailup-ruby/blob/master/lib/mailup/console/recipient.rb#L36
is wrong because recipient.update
returns a boolean
Ruby:
recipient = {
:Name => "Joe Public",
:Email => "[email protected]"
}
updated_recipient = mailup.console.recipient.update(recipient)
updated_recipient.Name
Results:
> updated_recipient = mailup.console.recipient.update(recipient)
=> true
> updated_recipient.Name
NoMethodError: undefined method `Name' for true:TrueClass
from (irb):183
from /Users/cdilanda/.rvm/rubies/ruby-2.1.0/bin/irb:11:in `<main>'
Moreover, we are currently not able to update our recipient.
Ruby:
group.add_recipients [{ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'Nature'}, {Id: 4, Value: 'London'}]}]
mailup.console.recipient.update({ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'diowa'}, {Id: 4, Value: 'Naples'}]})
Results:
> y group.recipients
---
IsPaginated: false
Items:
- Email: cesidio@example.com
Fields:
- Description: azienda
Id: 3
Value: Nature
- Description: città
Id: 4
Value: London
> mailup.console.recipient.update({ Email: '[email protected]', Name: 'C', Fields: [{Id: 3, Value: 'diowa'}, {Id: 4, Value: 'Naples'}]})
=> true
> y group.recipients
---
IsPaginated: false
Items:
- Email: cesidio@example.com
Fields:
- Description: azienda
Id: 3
Value: Nature
- Description: città
Id: 4
Value: London
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.