Giter VIP home page Giter VIP logo

mailup-ruby's People

Contributors

bgetting avatar byterussian avatar cesidio avatar nweb avatar scigoli avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mailup-ruby's Issues

Question about adding recipients to group

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

Issues with recipient update

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

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.