New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to send emails through different subaccounts inside a single rails application? #91
Comments
Hi @aalbagarcia, apologies for the delay in our response. You can reconfigure the wrapper as shown here before any API call or set of calls on a given API key but I'm not comfortable with the thread safety of this method. Depending on your App setup, you could run in unexpected issues should you have different part of your app modifying the global wrapper configuration. We're planning to move this configuration at the instance level - like the rest of our wrappers - allowing you to go beyond this issue. What do you think? |
@arnaudbreton I cannot reconfigure the wrapper; we are using sidekiq to send the emails and as you said, I could run into unexpected behaviour because it's not thread safe. While you move that configuration to the instance level, I'm using faraday to send the requests using the REST API. Looking forward to seeing this implemented. Thanks |
It sounds like a good workaround for now, apologies for the inconvenience. Keep you posted on our progress here |
Hello @aalbagarcia When you create a message with a mailer, this one instantiates its delivery method based on your global configuration (e.g. an instance of
If you are using the delivery method
The gem will be improved soon to do the same using attribute names of If you are using the delivery method I hope this can help |
Hi @aalbagarcia, following up on @Lorel last comment. I've just merged his PR, #95 which contains the update to use credentials local to the instance. Let us know if this works for you. It'll be part of the next release, Stay tuned and thanks for having chosen Mailjet to power your emails! |
@arnaudbreton I'm starting a course today till sunday so I don't think I'll have time to have a look at this until monday. Anyway, I had a look at @Lorel PR and it looks exactly what I was asking for so thanks a lot. I'll stay tuned. |
@aalbagarcia thanks for the feedback, glad to hear this PR sounds to work for you. Good luck with your course, please keep us posted. Cheers |
Hi,
We have different subaccounts defined in our mailjet user account. What we would like to do is from the same rails application, send user notifications through one of the subaccounts and send reports using another. Each subaccount has it's own API key and secret. My question is if it's possible to choose which subaccount to use when delivering the message.
According to the README, I can only define one API key and secret using an initializer so I see no way of doing it. I was wondering that maybe using the REST API I could do it.
Thanks
The text was updated successfully, but these errors were encountered: