Comments (6)
@paritoshbotre this seems relevant: SparkPost/php-sparkpost#66
from sparkpost_rails.
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.
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.
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.
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.
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)
- Devise emails sending as plaintext. HOT 7
- Sparkpost throws 500 when email is invalid, catching error doesn't work
- Passing `date` doesn't work HOT 1
- Rails 5.1 support HOT 8
- SparkPostRails::DeliveryException ([{"message"=>"invalid data format/type" HOT 2
- Potential Problem with CC: ActionMailer Parameter HOT 2
- SparkPostRails::DeliveryException ([{"message"=>"Unauthorized."}]) HOT 1
- Close this issue
- Turn off Sparkpost SMTP dynamically HOT 1
- Respect perform_deliveries option
- sparkpost_data ignored HOT 1
- Rails 5.2.0 Support
- Inline images aren't displaying inline HOT 1
- `sparkpost_data`is not persisted when mail is deserialized
- Invalid JSON errors with Ruby 2.6.0
- Attaching files
- Rails >= 6.0.0.rc2 Support HOT 3
- TLS depreciation
- 1.5.3 -> 1.5.5
- Rails 7.0.0 Support Timeline? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparkpost_rails.