Giter VIP home page Giter VIP logo

Comments (6)

kevinkimball avatar kevinkimball commented on July 26, 2024

@paritoshbotre this seems relevant: SparkPost/php-sparkpost#66

from sparkpost_rails.

zenzei avatar zenzei commented on July 26, 2024

Hi, sorry but I think this change has introduce some wrong behaviour.

Right now if I try to send a non transactional email like

to = ['[email protected]','[email protected]']
mail(to: to_email, subject: "Test", body: "test", sparkpost_data: {campaign_id: 'Test', transactional: false})

Both receipients are seeing not only their emails but the other emails to. I don't want that.

If I remove the header_to in the prepare_addresses the issue is fixed

    def prepare_addresses emails, names 
      emails = [emails] unless emails.is_a?(Array) 
      #header_to = emails.join(",") 
      #emails.each_with_index.map {|email, index| prepare_address(email, index, names, header_to) } 
      emails.each_with_index.map {|email, index| prepare_address(email, index, names, email) } 
    end 

Or maybe is just I'm using the api in a wrong way?

from sparkpost_rails.

zenzei avatar zenzei commented on July 26, 2024

Hi @paritoshbotre or @kevinkimball! Sorry to reask, did you saw this behaviour?

I don't want each receipient to see the others, and I'm not sure i'm using this in the right way. I don't want to display all "To" recipients, but that each receipient see only his/her email.

Thanks,

from sparkpost_rails.

jpaas avatar jpaas commented on July 26, 2024

I agree with @zenzei. I think this was not a great decision. Anyone using this list for non-transactional mailings are in for a really unpleasant surprise as we just discovered.

Now I'm trying to figure out if there's any way to disable this behavior so that non-transactional recipients don't see all the other recipients.

The safer thing to do would be to opt-in to revealing the other recipients.

from sparkpost_rails.

zenzei avatar zenzei commented on July 26, 2024

Hi @jpaas, if it helps what i have done is override the prepare_address in an initializer to rollback this behaviour.

module SparkPostRails 
  class DeliveryMethod

   private
    def prepare_address email, index, names, header_to
      #Rollback issue https://github.com/the-refinery/sparkpost_rails/issues/32, do not include all To  
      if !names[index].nil?
        #{ address:  { email: email, name: names[index], header_to: header_to } }
        { address:  { email: email, name: names[index] } }
      else  
        #{ address: { email: email, header_to: header_to } }
        { address: { email: email } } 
      end  
    end
    

  end
end

But the right thing to do would be adding some kind of option to choose before sending if the email of the others receipients should be seen or not.

from sparkpost_rails.

jpaas avatar jpaas commented on July 26, 2024

Thanks @zenzei. I already have to run a fork of this repo because of #41 , so I added something similar in my fork.

from sparkpost_rails.

Related Issues (20)

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.